@Test public void normalize() { AffMatchAffiliation aff = new AffMatchAffiliation("XXX", 1); aff.setOrganizationName("ICM_LONG"); aff.setCountryCode("PL"); aff.setCountryName("Poland"); when(organizationNameNormalizer.normalize("ICM_LONG")).thenReturn("icm long"); when(countryCodeNormalizer.normalize("PL")).thenReturn("pl"); when(countryNameNormalizer.normalize("Poland")).thenReturn("poland"); AffMatchAffiliation normalizedAff = normalizer.normalize(aff); assertTrue(aff != normalizedAff); assertEquals("XXX", normalizedAff.getDocumentId()); assertEquals(1, normalizedAff.getPosition()); assertEquals("icm long", normalizedAff.getOrganizationName()); assertEquals("pl", normalizedAff.getCountryCode()); assertEquals("poland", normalizedAff.getCountryName()); }
public AffMatchAffiliation normalize(AffMatchAffiliation affMatchAffiliation) { Preconditions.checkNotNull(affMatchAffiliation); AffMatchAffiliation normalizedAffiliation = new AffMatchAffiliation(affMatchAffiliation.getDocumentId(), affMatchAffiliation.getPosition()); normalizedAffiliation.setOrganizationName(organizationNameNormalizer.normalize(affMatchAffiliation.getOrganizationName())); normalizedAffiliation.setCountryName(countryNameNormalizer.normalize(affMatchAffiliation.getCountryName())); normalizedAffiliation.setCountryCode(countryCodeNormalizer.normalize(affMatchAffiliation.getCountryCode())); return normalizedAffiliation; }
AffMatchAffiliationNormalizer implements Serializable { public AffMatchAffiliation normalize(AffMatchAffiliation affMatchAffiliation) { Preconditions.checkNotNull(affMatchAffiliation); AffMatchAffiliation normalizedAffiliation = new AffMatchAffiliation(affMatchAffiliation.getDocumentId(), affMatchAffiliation.getPosition()); normalizedAffiliation.setOrganizationName(organizationNameNormalizer.normalize(affMatchAffiliation.getOrganizationName())); normalizedAffiliation.setCountryName(countryNameNormalizer.normalize(affMatchAffiliation.getCountryName())); normalizedAffiliation.setCountryCode(countryCodeNormalizer.normalize(affMatchAffiliation.getCountryCode())); return normalizedAffiliation; } }
AffMatchAffiliationNormalizer implements Serializable { public AffMatchAffiliation normalize(AffMatchAffiliation affMatchAffiliation) { Preconditions.checkNotNull(affMatchAffiliation); AffMatchAffiliation normalizedAffiliation = new AffMatchAffiliation(affMatchAffiliation.getDocumentId(), affMatchAffiliation.getPosition()); normalizedAffiliation.setOrganizationName(organizationNameNormalizer.normalize(affMatchAffiliation.getOrganizationName())); normalizedAffiliation.setCountryName(countryNameNormalizer.normalize(affMatchAffiliation.getCountryName())); normalizedAffiliation.setCountryCode(countryCodeNormalizer.normalize(affMatchAffiliation.getCountryCode())); return normalizedAffiliation; }  }
AffMatchAffiliationNormalizer implements Serializable { public AffMatchAffiliation normalize(AffMatchAffiliation affMatchAffiliation) { Preconditions.checkNotNull(affMatchAffiliation); AffMatchAffiliation normalizedAffiliation = new AffMatchAffiliation(affMatchAffiliation.getDocumentId(), affMatchAffiliation.getPosition()); normalizedAffiliation.setOrganizationName(organizationNameNormalizer.normalize(affMatchAffiliation.getOrganizationName())); normalizedAffiliation.setCountryName(countryNameNormalizer.normalize(affMatchAffiliation.getCountryName())); normalizedAffiliation.setCountryCode(countryCodeNormalizer.normalize(affMatchAffiliation.getCountryCode())); return normalizedAffiliation; }  AffMatchAffiliation normalize(AffMatchAffiliation affMatchAffiliation); void setOrganizationNameNormalizer(StringNormalizer organizationNameNormalizer); void setCountryNameNormalizer(StringNormalizer countryNameNormalizer); void setCountryCodeNormalizer(StringNormalizer countryCodeNormalizer); }
AffMatchAffiliationNormalizer implements Serializable { public AffMatchAffiliation normalize(AffMatchAffiliation affMatchAffiliation) { Preconditions.checkNotNull(affMatchAffiliation); AffMatchAffiliation normalizedAffiliation = new AffMatchAffiliation(affMatchAffiliation.getDocumentId(), affMatchAffiliation.getPosition()); normalizedAffiliation.setOrganizationName(organizationNameNormalizer.normalize(affMatchAffiliation.getOrganizationName())); normalizedAffiliation.setCountryName(countryNameNormalizer.normalize(affMatchAffiliation.getCountryName())); normalizedAffiliation.setCountryCode(countryCodeNormalizer.normalize(affMatchAffiliation.getCountryCode())); return normalizedAffiliation; }  AffMatchAffiliation normalize(AffMatchAffiliation affMatchAffiliation); void setOrganizationNameNormalizer(StringNormalizer organizationNameNormalizer); void setCountryNameNormalizer(StringNormalizer countryNameNormalizer); void setCountryCodeNormalizer(StringNormalizer countryCodeNormalizer);  }