Index: test/com/google/enterprise/adaptor/sharepoint/SharePointUserProfileAdaptorTest.java |
diff --git a/test/com/google/enterprise/adaptor/sharepoint/SharePointUserProfileAdaptorTest.java b/test/com/google/enterprise/adaptor/sharepoint/SharePointUserProfileAdaptorTest.java |
index 3ae4b786a897b658db20b6b2124eb57c5c847ddf..6ed1b9cbefad66df60dc40baa57d4f6a13bf6580 100644 |
--- a/test/com/google/enterprise/adaptor/sharepoint/SharePointUserProfileAdaptorTest.java |
+++ b/test/com/google/enterprise/adaptor/sharepoint/SharePointUserProfileAdaptorTest.java |
@@ -34,6 +34,7 @@ import org.w3c.dom.DOMImplementation; |
import java.io.ByteArrayInputStream; |
import java.io.ByteArrayOutputStream; |
import java.io.IOException; |
+import java.net.URI; |
import java.net.URLDecoder; |
import java.nio.charset.Charset; |
import java.util.ArrayList; |
@@ -146,7 +147,7 @@ public class SharePointUserProfileAdaptorTest { |
ArrayOfPropertyData profile = new ArrayOfPropertyData(); |
poulateProfileProperties(profile, |
SharePointUserProfileAdaptor.PROFILE_ACCOUNTNAME_PROPERTY, |
- new String[] {"user1"}); |
+ new String[] {"domain\\user1"}); |
poulateProfileProperties(profile, |
SharePointUserProfileAdaptor.PROFILE_PREFERRED_NAME_PROPERTY, |
new String[] {"First & Last"}); |
@@ -182,7 +183,8 @@ public class SharePointUserProfileAdaptorTest { |
cPrivate.setName("Private Colleague"); |
colleaguesData.getContactData().add(cPrivate); |
- serviceFactory.addUserProfileToCollection(1, 2, "user1", profile, colleaguesData); |
+ serviceFactory.addUserProfileToCollection(1, 2, "domain\\user1", |
+ profile, colleaguesData); |
adaptor = new SharePointUserProfileAdaptor(serviceFactory); |
AccumulatingDocIdPusher pusher = new AccumulatingDocIdPusher(); |
@@ -190,7 +192,8 @@ public class SharePointUserProfileAdaptorTest { |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
GetContentsRequest request = new GetContentsRequest( |
- new DocId(SharePointUserProfileAdaptor.SOCIAL_ID_PREFIX + "user1")); |
+ new DocId(SharePointUserProfileAdaptor.SOCIAL_ID_PREFIX |
+ + "domain\\user1")); |
GetContentsResponse response = new GetContentsResponse(baos); |
adaptor.getDocContent(request, response); |
@@ -200,7 +203,7 @@ public class SharePointUserProfileAdaptorTest { |
assertEquals(golden, responseString); |
assertFalse(response.isNotFound()); |
- assertEquals("user1", response.getMetadata().getOneValue( |
+ assertEquals("domain\\user1", response.getMetadata().getOneValue( |
"google_social_user_accountname")); |
assertEquals("Value1", response.getMetadata().getOneValue( |
"SP Single Value Property")); |
@@ -239,6 +242,9 @@ public class SharePointUserProfileAdaptorTest { |
String isInWorkGroup |
= pubContact.getAttributes().getNamedItem("gsa:isinworkinggroup").getNodeValue(); |
assertEquals("true", URLDecoder.decode(isInWorkGroup, "UTF-8")); |
+ |
+ assertEquals(URI.create("http://sharepoint.example.com/person.aspx?" |
+ + "accountname=domain%5Cuser1"), response.getDisplayUrl()); |