@Test public void testValidationWithTypeAll() throws Exception { final LinkedList<String> openSocialIds = new LinkedList<String>(); openSocialIds.add(SUBJECT_OPENSOCIAL_ID); openSocialIds.add(AUTHOR_OPENSOCIAL_ID); GetPeopleByOpenSocialIdsRequest currentRequest = new GetPeopleByOpenSocialIdsRequest(openSocialIds, "all"); ServiceActionContext currentContext = new ServiceActionContext(currentRequest, principal); sut.validate(currentContext); context.assertIsSatisfied(); }
@Override public void validate(final PrincipalActionContext inActionContext) throws ValidationException { GetPeopleByOpenSocialIdsRequest currentRequest = (GetPeopleByOpenSocialIdsRequest) inActionContext.getParams(); if (!currentRequest.getTypeOfRelationshipForPeopleReturned().equals("self") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("all") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("friends")) { throw new ValidationException("Unsupported relationship type provided."); } }
GetPeopleByOpenSocialIdsValidation implements ValidationStrategy<PrincipalActionContext> { @Override public void validate(final PrincipalActionContext inActionContext) throws ValidationException { GetPeopleByOpenSocialIdsRequest currentRequest = (GetPeopleByOpenSocialIdsRequest) inActionContext.getParams(); if (!currentRequest.getTypeOfRelationshipForPeopleReturned().equals("self") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("all") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("friends")) { throw new ValidationException("Unsupported relationship type provided."); } } }
GetPeopleByOpenSocialIdsValidation implements ValidationStrategy<PrincipalActionContext> { @Override public void validate(final PrincipalActionContext inActionContext) throws ValidationException { GetPeopleByOpenSocialIdsRequest currentRequest = (GetPeopleByOpenSocialIdsRequest) inActionContext.getParams(); if (!currentRequest.getTypeOfRelationshipForPeopleReturned().equals("self") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("all") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("friends")) { throw new ValidationException("Unsupported relationship type provided."); } }  }
GetPeopleByOpenSocialIdsValidation implements ValidationStrategy<PrincipalActionContext> { @Override public void validate(final PrincipalActionContext inActionContext) throws ValidationException { GetPeopleByOpenSocialIdsRequest currentRequest = (GetPeopleByOpenSocialIdsRequest) inActionContext.getParams(); if (!currentRequest.getTypeOfRelationshipForPeopleReturned().equals("self") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("all") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("friends")) { throw new ValidationException("Unsupported relationship type provided."); } }  @Override void validate(final PrincipalActionContext inActionContext); }
GetPeopleByOpenSocialIdsValidation implements ValidationStrategy<PrincipalActionContext> { @Override public void validate(final PrincipalActionContext inActionContext) throws ValidationException { GetPeopleByOpenSocialIdsRequest currentRequest = (GetPeopleByOpenSocialIdsRequest) inActionContext.getParams(); if (!currentRequest.getTypeOfRelationshipForPeopleReturned().equals("self") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("all") && !currentRequest.getTypeOfRelationshipForPeopleReturned().equals("friends")) { throw new ValidationException("Unsupported relationship type provided."); } }  @Override void validate(final PrincipalActionContext inActionContext);  }