@Test public void tryToMap_foundOneMapping() { List<Identity> twoIdentities = new ArrayList<Identity>(); twoIdentities.add(identityMockOne); when( baseSecurityMock.getVisibleIdentitiesByPowerSearch(anyString(), anyMap(), anyBoolean(), any(SecurityGroup[].class), any(PermissionOnResourceable[].class), any(String[].class), any(Date.class), any(Date.class))).thenReturn(twoIdentities); Identity mappedIdentity = studentMappingByMartikelNumberTestObject.tryToMap(studentMock); assertNotNull("Must return an identity, when only one mapping exists", mappedIdentity); }
public Identity tryToMap(Student student) { Identity identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, student.getRegistrationNr()); if (identity == null) { identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, StringUtils.remove(student.getRegistrationNr(), "-")); } return identity; }
StudentMappingByMartikelNumber extends AbstractMappingByInstitutionalIdentifier { public Identity tryToMap(Student student) { Identity identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, student.getRegistrationNr()); if (identity == null) { identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, StringUtils.remove(student.getRegistrationNr(), "-")); } return identity; } }
StudentMappingByMartikelNumber extends AbstractMappingByInstitutionalIdentifier { public Identity tryToMap(Student student) { Identity identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, student.getRegistrationNr()); if (identity == null) { identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, StringUtils.remove(student.getRegistrationNr(), "-")); } return identity; }  }
StudentMappingByMartikelNumber extends AbstractMappingByInstitutionalIdentifier { public Identity tryToMap(Student student) { Identity identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, student.getRegistrationNr()); if (identity == null) { identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, StringUtils.remove(student.getRegistrationNr(), "-")); } return identity; }  Identity tryToMap(Student student); }
StudentMappingByMartikelNumber extends AbstractMappingByInstitutionalIdentifier { public Identity tryToMap(Student student) { Identity identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, student.getRegistrationNr()); if (identity == null) { identity = tryToMap(UserConstants.INSTITUTIONAL_MATRICULATION_NUMBER, StringUtils.remove(student.getRegistrationNr(), "-")); } return identity; }  Identity tryToMap(Student student);  }