@Test(expected = BadRequestException.class) public void convertEncodedIdWithMissingMember() { securityServerConverter.convertId("XRD2:GOV:serverCode"); }
public SecurityServerId convertId(String encodedId) { validateEncodedString(encodedId); int serverCodeSeparatorIndex = encodedId.lastIndexOf( ENCODED_ID_SEPARATOR); String encodedMemberClientId = encodedId.substring(0, serverCodeSeparatorIndex); ClientId memberClientId = clientConverter.convertId(encodedMemberClientId); String serverCode = encodedId.substring(serverCodeSeparatorIndex + 1); SecurityServerId securityServerId = SecurityServerId.create(memberClientId, serverCode); return securityServerId; }
SecurityServerConverter { public SecurityServerId convertId(String encodedId) { validateEncodedString(encodedId); int serverCodeSeparatorIndex = encodedId.lastIndexOf( ENCODED_ID_SEPARATOR); String encodedMemberClientId = encodedId.substring(0, serverCodeSeparatorIndex); ClientId memberClientId = clientConverter.convertId(encodedMemberClientId); String serverCode = encodedId.substring(serverCodeSeparatorIndex + 1); SecurityServerId securityServerId = SecurityServerId.create(memberClientId, serverCode); return securityServerId; } }
SecurityServerConverter { public SecurityServerId convertId(String encodedId) { validateEncodedString(encodedId); int serverCodeSeparatorIndex = encodedId.lastIndexOf( ENCODED_ID_SEPARATOR); String encodedMemberClientId = encodedId.substring(0, serverCodeSeparatorIndex); ClientId memberClientId = clientConverter.convertId(encodedMemberClientId); String serverCode = encodedId.substring(serverCodeSeparatorIndex + 1); SecurityServerId securityServerId = SecurityServerId.create(memberClientId, serverCode); return securityServerId; } @Autowired  SecurityServerConverter(ClientConverter clientConverter, GlobalConfFacade globalConfFacade); }
SecurityServerConverter { public SecurityServerId convertId(String encodedId) { validateEncodedString(encodedId); int serverCodeSeparatorIndex = encodedId.lastIndexOf( ENCODED_ID_SEPARATOR); String encodedMemberClientId = encodedId.substring(0, serverCodeSeparatorIndex); ClientId memberClientId = clientConverter.convertId(encodedMemberClientId); String serverCode = encodedId.substring(serverCodeSeparatorIndex + 1); SecurityServerId securityServerId = SecurityServerId.create(memberClientId, serverCode); return securityServerId; } @Autowired  SecurityServerConverter(ClientConverter clientConverter, GlobalConfFacade globalConfFacade); SecurityServerId convertId(String encodedId); String convertId(SecurityServerId securityServerId); SecurityServer convert(SecurityServerId securityServerId); List<SecurityServer> convert(Iterable<SecurityServerId> securityServerIds); }
SecurityServerConverter { public SecurityServerId convertId(String encodedId) { validateEncodedString(encodedId); int serverCodeSeparatorIndex = encodedId.lastIndexOf( ENCODED_ID_SEPARATOR); String encodedMemberClientId = encodedId.substring(0, serverCodeSeparatorIndex); ClientId memberClientId = clientConverter.convertId(encodedMemberClientId); String serverCode = encodedId.substring(serverCodeSeparatorIndex + 1); SecurityServerId securityServerId = SecurityServerId.create(memberClientId, serverCode); return securityServerId; } @Autowired  SecurityServerConverter(ClientConverter clientConverter, GlobalConfFacade globalConfFacade); SecurityServerId convertId(String encodedId); String convertId(SecurityServerId securityServerId); SecurityServer convert(SecurityServerId securityServerId); List<SecurityServer> convert(Iterable<SecurityServerId> securityServerIds); static final int SECURITY_SERVER_CODE_INDEX; }