Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(442)

Unified Diff: test/com/google/enterprise/adaptor/sharepoint/SharePointUserProfileAdaptorTest.java

Issue 13191044: Display URL support for user profile adaotor (Closed)
Patch Set: with code review comments Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b