diff options
-rw-r--r-- | ivy.xml | 3 | ||||
-rw-r--r-- | src/com/p4square/f1oauth/FellowshipOneIntegrationDriver.java | 45 | ||||
-rw-r--r-- | src/com/p4square/grow/ccb/CCBUser.java | 37 | ||||
-rw-r--r-- | src/com/p4square/grow/ccb/CCBUserVerifier.java | 50 | ||||
-rw-r--r-- | src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java | 50 | ||||
-rw-r--r-- | src/com/p4square/grow/ccb/MonitoredCCBAPI.java | 68 | ||||
-rw-r--r-- | src/com/p4square/grow/frontend/AssessmentResultsPage.java | 4 | ||||
-rw-r--r-- | src/com/p4square/grow/frontend/ChapterCompletePage.java | 4 | ||||
-rw-r--r-- | src/com/p4square/grow/frontend/GrowFrontend.java | 39 | ||||
-rw-r--r-- | src/com/p4square/grow/frontend/IntegrationDriver.java | 17 | ||||
-rw-r--r-- | src/com/p4square/grow/frontend/NewAccountResource.java | 16 | ||||
-rw-r--r-- | tst/com/p4square/grow/ccb/CCBUserVerifierTest.java | 139 |
12 files changed, 449 insertions, 23 deletions
@@ -24,7 +24,10 @@ <dependency org="log4j" name="log4j" rev="[1.2,)" conf="default" /> + <dependency org="com.p4square" name="ccbapi" rev="1.0-SNAPSHOT" conf="default" /> + <dependency org="junit" name="junit" rev="4.7" conf="test" /> + <dependency org="org.easymock" name="easymock" rev="3.4" conf="test" /> <dependency org="net.sourceforge.cobertura" name="cobertura" rev="2.1.1" conf="test" /> <!-- Backend Dependencies --> diff --git a/src/com/p4square/f1oauth/FellowshipOneIntegrationDriver.java b/src/com/p4square/f1oauth/FellowshipOneIntegrationDriver.java new file mode 100644 index 0000000..e72df5e --- /dev/null +++ b/src/com/p4square/f1oauth/FellowshipOneIntegrationDriver.java @@ -0,0 +1,45 @@ +package com.p4square.f1oauth; + +import com.codahale.metrics.MetricRegistry; +import com.p4square.grow.config.Config; +import com.p4square.grow.frontend.IntegrationDriver; +import org.restlet.Context; +import org.restlet.security.Verifier; + +/** + * The FellowshipOneIntegrationDriver creates implementations of various + * objects to support integration with Fellowship One. + */ +public class FellowshipOneIntegrationDriver implements IntegrationDriver { + + private final Context mContext; + private final MetricRegistry mMetricRegistry; + private final Config mConfig; + private final F1Access mAPI; + + public FellowshipOneIntegrationDriver(final Context context) { + mContext = context; + mConfig = (Config) context.getAttributes().get("com.p4square.grow.config"); + mMetricRegistry = (MetricRegistry) context.getAttributes().get("com.p4square.grow.metrics"); + + mAPI = new F1Access(context, + mConfig.getString("f1ConsumerKey", ""), + mConfig.getString("f1ConsumerSecret", ""), + mConfig.getString("f1BaseUrl", "staging.fellowshiponeapi.com"), + mConfig.getString("f1ChurchCode", "pfseawa"), + F1Access.UserType.WEBLINK); + mAPI.setMetricRegistry(mMetricRegistry); + } + + /** + * @return An F1Access instance. + */ + public F1Access getF1Access() { + return mAPI; + } + + @Override + public Verifier newUserAuthenticationVerifier() { + return new SecondPartyVerifier(mContext, mAPI); + } +} diff --git a/src/com/p4square/grow/ccb/CCBUser.java b/src/com/p4square/grow/ccb/CCBUser.java new file mode 100644 index 0000000..7313172 --- /dev/null +++ b/src/com/p4square/grow/ccb/CCBUser.java @@ -0,0 +1,37 @@ +package com.p4square.grow.ccb; + +import com.p4square.ccbapi.model.IndividualProfile; +import org.restlet.security.User; + +/** + * CCBUser is an adapter between a CCB IndividualProfile and a Restlet User. + * + * Note: CCBUser prefixes the user's identifier with "CCB-". This is done to + * ensure the identifier does not collide with identifiers from other + * systems. + */ +public class CCBUser extends User { + + private final IndividualProfile mProfile; + + /** + * Wrap an IndividualProfile inside a User object. + * + * @param profile The CCB IndividualProfile for the user. + */ + public CCBUser(final IndividualProfile profile) { + mProfile = profile; + + setIdentifier("CCB-" + mProfile.getId()); + setFirstName(mProfile.getFirstName()); + setLastName(mProfile.getLastName()); + setEmail(mProfile.getEmail()); + } + + /** + * @return The IndividualProfile of the user. + */ + public IndividualProfile getProfile() { + return mProfile; + } +} diff --git a/src/com/p4square/grow/ccb/CCBUserVerifier.java b/src/com/p4square/grow/ccb/CCBUserVerifier.java new file mode 100644 index 0000000..db10b75 --- /dev/null +++ b/src/com/p4square/grow/ccb/CCBUserVerifier.java @@ -0,0 +1,50 @@ +package com.p4square.grow.ccb; + +import com.p4square.ccbapi.CCBAPI; +import com.p4square.ccbapi.model.GetIndividualProfilesRequest; +import com.p4square.ccbapi.model.GetIndividualProfilesResponse; +import org.apache.log4j.Logger; +import org.restlet.Request; +import org.restlet.Response; +import org.restlet.security.Verifier; + +/** + * CCBUserVerifier authenticates a user through the CCB individual_profile_from_login_password API. + */ +public class CCBUserVerifier implements Verifier { + private static final Logger LOG = Logger.getLogger(CCBUserVerifier.class); + + private final CCBAPI mAPI; + + public CCBUserVerifier(final CCBAPI api) { + mAPI = api; + } + + @Override + public int verify(Request request, Response response) { + if (request.getChallengeResponse() == null) { + return RESULT_MISSING; // no credentials + } + + final String username = request.getChallengeResponse().getIdentifier(); + final char[] password = request.getChallengeResponse().getSecret(); + + try { + GetIndividualProfilesResponse resp = mAPI.getIndividualProfiles( + new GetIndividualProfilesRequest().withLoginPassword(username, password)); + + if (resp.getIndividuals().size() == 1) { + // Wrap the IndividualProfile up in an User and update the user on the request. + final CCBUser user = new CCBUser(resp.getIndividuals().get(0)); + LOG.info("Successfully authenticated " + user.getIdentifier()); + request.getClientInfo().setUser(user); + return RESULT_VALID; + } + + } catch (Exception e) { + LOG.error("CCB API Exception: " + e, e); + } + + return RESULT_INVALID; // Invalid credentials + } +} diff --git a/src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java b/src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java new file mode 100644 index 0000000..3aeca2c --- /dev/null +++ b/src/com/p4square/grow/ccb/ChurchCommunityBuilderIntegrationDriver.java @@ -0,0 +1,50 @@ +package com.p4square.grow.ccb; + +import com.codahale.metrics.MetricRegistry; +import com.p4square.ccbapi.CCBAPI; +import com.p4square.ccbapi.CCBAPIClient; +import com.p4square.grow.config.Config; +import com.p4square.grow.frontend.IntegrationDriver; +import org.restlet.Context; +import org.restlet.security.Verifier; + +import java.net.URI; +import java.net.URISyntaxException; + +/** + * The ChurchCommunityBuilderIntegrationDriver is used to integrate Grow with Church Community Builder. + */ +public class ChurchCommunityBuilderIntegrationDriver implements IntegrationDriver { + + private final Context mContext; + private final MetricRegistry mMetricRegistry; + private final Config mConfig; + + private final CCBAPI mAPI; + + public ChurchCommunityBuilderIntegrationDriver(final Context context) { + mContext = context; + mConfig = (Config) context.getAttributes().get("com.p4square.grow.config"); + mMetricRegistry = (MetricRegistry) context.getAttributes().get("com.p4square.grow.metrics"); + + try { + CCBAPI api = new CCBAPIClient(new URI(mConfig.getString("CCBAPIURL", "")), + mConfig.getString("CCBAPIUser", ""), + mConfig.getString("CCBAPIPassword", "")); + + if (mMetricRegistry != null) { + api = new MonitoredCCBAPI(api, mMetricRegistry); + } + + mAPI = api; + + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } + + @Override + public Verifier newUserAuthenticationVerifier() { + return new CCBUserVerifier(mAPI); + } +} diff --git a/src/com/p4square/grow/ccb/MonitoredCCBAPI.java b/src/com/p4square/grow/ccb/MonitoredCCBAPI.java new file mode 100644 index 0000000..6903460 --- /dev/null +++ b/src/com/p4square/grow/ccb/MonitoredCCBAPI.java @@ -0,0 +1,68 @@ +package com.p4square.grow.ccb; + +import com.codahale.metrics.MetricRegistry; +import com.codahale.metrics.Timer; +import com.p4square.ccbapi.CCBAPI; +import com.p4square.ccbapi.model.GetCustomFieldLabelsResponse; +import com.p4square.ccbapi.model.GetIndividualProfilesRequest; +import com.p4square.ccbapi.model.GetIndividualProfilesResponse; + +import java.io.IOException; + +/** + * MonitoredCCBAPI is a CCBAPI decorator which records metrics for each API call. + */ +public class MonitoredCCBAPI implements CCBAPI { + + private final CCBAPI mAPI; + private final MetricRegistry mMetricRegistry; + + public MonitoredCCBAPI(final CCBAPI api, final MetricRegistry metricRegistry) { + if (api == null) { + throw new IllegalArgumentException("api must not be null."); + } + mAPI = api; + + if (metricRegistry == null) { + throw new IllegalArgumentException("metricRegistry must not be null."); + } + mMetricRegistry = metricRegistry; + } + + @Override + public GetCustomFieldLabelsResponse getCustomFieldLabels() throws IOException { + final Timer.Context timer = mMetricRegistry.timer("CCBAPI.getCustomFieldLabels.time").time(); + boolean success = false; + try { + final GetCustomFieldLabelsResponse resp = mAPI.getCustomFieldLabels(); + success = true; + return resp; + } finally { + timer.stop(); + mMetricRegistry.counter("CCBAPI.getCustomFieldLabels.success").inc(success ? 1 : 0); + mMetricRegistry.counter("CCBAPI.getCustomFieldLabels.failure").inc(!success ? 1 : 0); + } + } + + @Override + public GetIndividualProfilesResponse getIndividualProfiles(GetIndividualProfilesRequest request) + throws IOException { + final Timer.Context timer = mMetricRegistry.timer("CCBAPI.getIndividualProfiles").time(); + boolean success = false; + try { + final GetIndividualProfilesResponse resp = mAPI.getIndividualProfiles(request); + mMetricRegistry.counter("CCBAPI.getCustomFieldLabels.count").inc(resp.getIndividuals().size()); + success = true; + return resp; + } finally { + timer.stop(); + mMetricRegistry.counter("CCBAPI.getCustomFieldLabels.success").inc(success ? 1 : 0); + mMetricRegistry.counter("CCBAPI.getCustomFieldLabels.failure").inc(!success ? 1 : 0); + } + } + + @Override + public void close() throws IOException { + mAPI.close(); + } +} diff --git a/src/com/p4square/grow/frontend/AssessmentResultsPage.java b/src/com/p4square/grow/frontend/AssessmentResultsPage.java index 2035ce8..9b66794 100644 --- a/src/com/p4square/grow/frontend/AssessmentResultsPage.java +++ b/src/com/p4square/grow/frontend/AssessmentResultsPage.java @@ -7,6 +7,7 @@ package com.p4square.grow.frontend; import java.util.Date; import java.util.Map; +import com.p4square.f1oauth.FellowshipOneIntegrationDriver; import freemarker.template.Template; import org.restlet.data.MediaType; @@ -117,7 +118,8 @@ public class AssessmentResultsPage extends FreeMarkerPageResource { attribute.setStartDate(new Date()); attribute.setComment(JsonEncodedProvider.MAPPER.writeValueAsString(results)); - F1API f1 = mGrowFrontend.getF1Access().getAuthenticatedApi(user); + F1API f1 = ((FellowshipOneIntegrationDriver) mGrowFrontend.getThirdPartyIntegrationFactory()) + .getF1Access().getAuthenticatedApi(user); if (!f1.addAttribute(user.getIdentifier(), attribute)) { LOG.error("addAttribute failed for " + user.getIdentifier() + " with attribute " + attributeName); diff --git a/src/com/p4square/grow/frontend/ChapterCompletePage.java b/src/com/p4square/grow/frontend/ChapterCompletePage.java index f07a870..2dd1ecf 100644 --- a/src/com/p4square/grow/frontend/ChapterCompletePage.java +++ b/src/com/p4square/grow/frontend/ChapterCompletePage.java @@ -7,6 +7,7 @@ package com.p4square.grow.frontend; import java.util.Date; import java.util.Map; +import com.p4square.f1oauth.FellowshipOneIntegrationDriver; import freemarker.template.Template; import org.restlet.data.MediaType; @@ -172,7 +173,8 @@ public class ChapterCompletePage extends FreeMarkerPageResource { Attribute attribute = new Attribute(attributeName); attribute.setStartDate(new Date()); - F1API f1 = mGrowFrontend.getF1Access().getAuthenticatedApi(user); + F1API f1 = ((FellowshipOneIntegrationDriver) mGrowFrontend.getThirdPartyIntegrationFactory()) + .getF1Access().getAuthenticatedApi(user); if (!f1.addAttribute(user.getIdentifier(), attribute)) { LOG.error("addAttribute failed for " + user.getIdentifier() + " with attribute " + attributeName); diff --git a/src/com/p4square/grow/frontend/GrowFrontend.java b/src/com/p4square/grow/frontend/GrowFrontend.java index 1d221cc..b5f62fb 100644 --- a/src/com/p4square/grow/frontend/GrowFrontend.java +++ b/src/com/p4square/grow/frontend/GrowFrontend.java @@ -6,15 +6,12 @@ package com.p4square.grow.frontend; import java.io.File; import java.io.IOException; - -import java.util.Arrays; -import java.util.UUID; +import java.lang.reflect.Constructor; import freemarker.template.Template; import org.restlet.Application; import org.restlet.Component; -import org.restlet.Client; import org.restlet.Context; import org.restlet.Restlet; import org.restlet.data.Protocol; @@ -32,13 +29,11 @@ import com.p4square.fmfacade.FreeMarkerPageResource; import com.p4square.grow.config.Config; -import com.p4square.f1oauth.F1Access; -import com.p4square.f1oauth.SecondPartyVerifier; - import com.p4square.restlet.metrics.MetricRouter; import com.p4square.session.SessionCheckingAuthenticator; import com.p4square.session.SessionCreatingAuthenticator; +import org.restlet.security.Verifier; /** * This is the Restlet Application implementing the Grow project front-end. @@ -54,7 +49,7 @@ public class GrowFrontend extends FMFacade { private final Config mConfig; private final MetricRegistry mMetricRegistry; - private F1Access mHelper; + private IntegrationDriver mIntegrationFactory; public GrowFrontend() { this(new Config(), new MetricRegistry()); @@ -81,20 +76,26 @@ public class GrowFrontend extends FMFacade { FreeMarkerPageResource.baseRootObject(getContext(), this)); } + getContext().getAttributes().put("com.p4square.grow.config", mConfig); + getContext().getAttributes().put("com.p4square.grow.metrics", mMetricRegistry); + super.start(); } - synchronized F1Access getF1Access() { - if (mHelper == null) { - mHelper = new F1Access(getContext(), mConfig.getString("f1ConsumerKey", ""), - mConfig.getString("f1ConsumerSecret", ""), - mConfig.getString("f1BaseUrl", "staging.fellowshiponeapi.com"), - mConfig.getString("f1ChurchCode", "pfseawa"), - F1Access.UserType.WEBLINK); - mHelper.setMetricRegistry(mMetricRegistry); + public synchronized IntegrationDriver getThirdPartyIntegrationFactory() { + if (mIntegrationFactory == null) { + final String driverClassName = getConfig().getString("integrationDriver", + "com.p4square.f1oauth.FellowshipOneIntegrationDriver"); + try { + Class<?> clazz = Class.forName(driverClassName); + Constructor<?> constructor = clazz.getConstructor(Context.class); + mIntegrationFactory = (IntegrationDriver) constructor.newInstance(getContext()); + } catch (Exception e) { + LOG.error("Failed to instantiate IntegrationDriver " + driverClassName); + } } - return mHelper; + return mIntegrationFactory; } @Override @@ -141,8 +142,8 @@ public class GrowFrontend extends FMFacade { SessionCheckingAuthenticator sessionChk = new SessionCheckingAuthenticator(context, true); // This is used to authenticate the user - SecondPartyVerifier f1Verifier = new SecondPartyVerifier(context, getF1Access()); - LoginFormAuthenticator loginAuth = new LoginFormAuthenticator(context, false, f1Verifier); + Verifier verifier = getThirdPartyIntegrationFactory().newUserAuthenticationVerifier(); + LoginFormAuthenticator loginAuth = new LoginFormAuthenticator(context, false, verifier); loginAuth.setLoginFormUrl(loginPage); loginAuth.setLoginPostUrl(loginPost); loginAuth.setDefaultPage(defaultPage); diff --git a/src/com/p4square/grow/frontend/IntegrationDriver.java b/src/com/p4square/grow/frontend/IntegrationDriver.java new file mode 100644 index 0000000..3370116 --- /dev/null +++ b/src/com/p4square/grow/frontend/IntegrationDriver.java @@ -0,0 +1,17 @@ +package com.p4square.grow.frontend; + +import org.restlet.security.Verifier; + +/** + * An IntegrationDriver is used to create implementations of various objects + * used to integration Grow with a particular Church Management System. + */ +public interface IntegrationDriver { + + /** + * Create a new Restlet Verifier to authenticate users when they login to the site. + * + * @return A Verifier. + */ + Verifier newUserAuthenticationVerifier(); +} diff --git a/src/com/p4square/grow/frontend/NewAccountResource.java b/src/com/p4square/grow/frontend/NewAccountResource.java index 54c1790..5c13017 100644 --- a/src/com/p4square/grow/frontend/NewAccountResource.java +++ b/src/com/p4square/grow/frontend/NewAccountResource.java @@ -6,12 +6,12 @@ package com.p4square.grow.frontend; import java.util.Map; +import com.p4square.f1oauth.FellowshipOneIntegrationDriver; import freemarker.template.Template; import org.restlet.data.Form; import org.restlet.data.MediaType; import org.restlet.data.Status; -import org.restlet.resource.ServerResource; import org.restlet.representation.Representation; import org.restlet.representation.StringRepresentation; import org.restlet.ext.freemarker.TemplateRepresentation; @@ -44,7 +44,14 @@ public class NewAccountResource extends FreeMarkerPageResource { super.doInit(); mGrowFrontend = (GrowFrontend) getApplication(); - mHelper = mGrowFrontend.getF1Access(); + + final IntegrationDriver driver = mGrowFrontend.getThirdPartyIntegrationFactory(); + if (driver instanceof FellowshipOneIntegrationDriver) { + mHelper = ((FellowshipOneIntegrationDriver) driver).getF1Access(); + } else { + LOG.error("NewAccountResource only works with F1!"); + mHelper = null; + } mErrorMessage = ""; @@ -83,6 +90,11 @@ public class NewAccountResource extends FreeMarkerPageResource { @Override protected Representation post(Representation rep) { + if (mHelper == null) { + mErrorMessage += "F1 support is not enabled! "; + return get(); + } + Form form = new Form(rep); String firstname = form.getFirstValue("firstname"); diff --git a/tst/com/p4square/grow/ccb/CCBUserVerifierTest.java b/tst/com/p4square/grow/ccb/CCBUserVerifierTest.java new file mode 100644 index 0000000..d17b698 --- /dev/null +++ b/tst/com/p4square/grow/ccb/CCBUserVerifierTest.java @@ -0,0 +1,139 @@ +package com.p4square.grow.ccb; + +import com.p4square.ccbapi.CCBAPI; +import com.p4square.ccbapi.model.GetIndividualProfilesRequest; +import com.p4square.ccbapi.model.GetIndividualProfilesResponse; +import com.p4square.ccbapi.model.IndividualProfile; +import org.easymock.EasyMock; +import org.junit.Before; +import org.junit.Test; +import org.restlet.Request; +import org.restlet.Response; +import org.restlet.data.ChallengeResponse; +import org.restlet.data.ChallengeScheme; +import org.restlet.data.ClientInfo; +import org.restlet.security.Verifier; + +import java.io.IOException; +import java.util.Collections; + +import static org.junit.Assert.*; + +/** + * Tests for CCBUserVerifier. + */ +public class CCBUserVerifierTest { + + private IndividualProfile mProfile = new IndividualProfile(); + + private CCBAPI mAPI; + private CCBUserVerifier verifier; + + private ClientInfo mClientInfo; + private Request mMockRequest; + private Response mMockResponse; + + @Before + public void setUp() { + mAPI = EasyMock.mock(CCBAPI.class); + verifier = new CCBUserVerifier(mAPI); + + mClientInfo = new ClientInfo(); + mMockRequest = EasyMock.mock(Request.class); + EasyMock.expect(mMockRequest.getClientInfo()).andReturn(mClientInfo).anyTimes(); + + mMockResponse = EasyMock.mock(Response.class); + + mProfile.setId(48); + mProfile.setFirstName("Larry"); + mProfile.setLastName("Bob"); + mProfile.setEmail("larry.bob@example.com"); + } + + private void replay() { + EasyMock.replay(mAPI, mMockRequest, mMockResponse); + } + + private void verify() { + EasyMock.verify(mAPI, mMockRequest, mMockResponse); + } + + + @Test + public void testVerifyNoCredentials() throws Exception { + // Prepare mocks + EasyMock.expect(mMockRequest.getChallengeResponse()).andReturn(null).anyTimes(); + replay(); + + // Test + int result = verifier.verify(mMockRequest, mMockResponse); + + // Verify + verify(); + assertEquals(Verifier.RESULT_MISSING, result); + assertNull(mClientInfo.getUser()); + } + + @Test + public void testVerifyAuthFailure() throws Exception { + // Prepare mocks + ChallengeResponse challenge = new ChallengeResponse(ChallengeScheme.HTTP_BASIC, "user", "pass"); + EasyMock.expect(mMockRequest.getChallengeResponse()).andReturn(challenge).anyTimes(); + GetIndividualProfilesResponse response = new GetIndividualProfilesResponse(); + response.setIndividuals(Collections.<IndividualProfile>emptyList()); + EasyMock.expect(mAPI.getIndividualProfiles(new GetIndividualProfilesRequest() + .withLoginPassword("user", "pass".toCharArray()))).andReturn(response); + replay(); + + // Test + int result = verifier.verify(mMockRequest, mMockResponse); + + // Verify + verify(); + assertEquals(Verifier.RESULT_INVALID, result); + assertNull(mClientInfo.getUser()); + } + + @Test + public void testVerifyAuthException() throws Exception { + // Prepare mocks + ChallengeResponse challenge = new ChallengeResponse(ChallengeScheme.HTTP_BASIC, "user", "pass"); + EasyMock.expect(mMockRequest.getChallengeResponse()).andReturn(challenge).anyTimes(); + EasyMock.expect(mAPI.getIndividualProfiles(EasyMock.anyObject(GetIndividualProfilesRequest.class))) + .andThrow(new IOException()); + replay(); + + // Test + int result = verifier.verify(mMockRequest, mMockResponse); + + // Verify + verify(); + assertEquals(Verifier.RESULT_INVALID, result); + assertNull(mClientInfo.getUser()); + } + + @Test + public void testVerifyAuthSuccess() throws Exception { + // Prepare mocks + ChallengeResponse challenge = new ChallengeResponse(ChallengeScheme.HTTP_BASIC, "user", "pass"); + EasyMock.expect(mMockRequest.getChallengeResponse()).andReturn(challenge).anyTimes(); + GetIndividualProfilesResponse response = new GetIndividualProfilesResponse(); + response.setIndividuals(Collections.singletonList(mProfile)); + EasyMock.expect(mAPI.getIndividualProfiles(new GetIndividualProfilesRequest() + .withLoginPassword("user", "pass".toCharArray()))).andReturn(response); + + replay(); + + // Test + int result = verifier.verify(mMockRequest, mMockResponse); + + // Verify + verify(); + assertEquals(Verifier.RESULT_VALID, result); + assertNotNull(mClientInfo.getUser()); + assertEquals("CCB-48", mClientInfo.getUser().getIdentifier()); + assertEquals("Larry", mClientInfo.getUser().getFirstName()); + assertEquals("Bob", mClientInfo.getUser().getLastName()); + assertEquals("larry.bob@example.com", mClientInfo.getUser().getEmail()); + } +}
\ No newline at end of file |