@Test public void convert_null_properties() { organization.setName(null); organization.setShortName(null); organization.setCountryCode(null); organization.setCountryName(null); organization.setWebsiteUrl(null); AffMatchOrganization affMatchOrg = converter.convert(organization); assertEquals(organization.getId(), affMatchOrg.getId()); assertEquals("", affMatchOrg.getName()); assertEquals("", affMatchOrg.getShortName()); assertEquals("", affMatchOrg.getCountryName()); assertEquals("", affMatchOrg.getCountryCode()); assertEquals("", affMatchOrg.getWebsiteUrl()); }
public AffMatchOrganization convert(Organization organization) { Preconditions.checkNotNull(organization); Preconditions.checkArgument(StringUtils.isNotBlank(organization.getId())); AffMatchOrganization affMatchOrg = new AffMatchOrganization(organization.getId().toString()); String orgName = toStringWithNullToEmpty(organization.getName()); if (orgName.trim().equalsIgnoreCase("missing legal name")) { orgName = ""; } affMatchOrg.setName(orgName); affMatchOrg.setShortName(toStringWithNullToEmpty(organization.getShortName())); affMatchOrg.setCountryName(toStringWithNullToEmpty(organization.getCountryName())); affMatchOrg.setCountryCode(toStringWithNullToEmpty(organization.getCountryCode())); affMatchOrg.setWebsiteUrl(toStringWithNullToEmpty(organization.getWebsiteUrl())); return affMatchOrg; }
OrganizationConverter implements Serializable { public AffMatchOrganization convert(Organization organization) { Preconditions.checkNotNull(organization); Preconditions.checkArgument(StringUtils.isNotBlank(organization.getId())); AffMatchOrganization affMatchOrg = new AffMatchOrganization(organization.getId().toString()); String orgName = toStringWithNullToEmpty(organization.getName()); if (orgName.trim().equalsIgnoreCase("missing legal name")) { orgName = ""; } affMatchOrg.setName(orgName); affMatchOrg.setShortName(toStringWithNullToEmpty(organization.getShortName())); affMatchOrg.setCountryName(toStringWithNullToEmpty(organization.getCountryName())); affMatchOrg.setCountryCode(toStringWithNullToEmpty(organization.getCountryCode())); affMatchOrg.setWebsiteUrl(toStringWithNullToEmpty(organization.getWebsiteUrl())); return affMatchOrg; } }
OrganizationConverter implements Serializable { public AffMatchOrganization convert(Organization organization) { Preconditions.checkNotNull(organization); Preconditions.checkArgument(StringUtils.isNotBlank(organization.getId())); AffMatchOrganization affMatchOrg = new AffMatchOrganization(organization.getId().toString()); String orgName = toStringWithNullToEmpty(organization.getName()); if (orgName.trim().equalsIgnoreCase("missing legal name")) { orgName = ""; } affMatchOrg.setName(orgName); affMatchOrg.setShortName(toStringWithNullToEmpty(organization.getShortName())); affMatchOrg.setCountryName(toStringWithNullToEmpty(organization.getCountryName())); affMatchOrg.setCountryCode(toStringWithNullToEmpty(organization.getCountryCode())); affMatchOrg.setWebsiteUrl(toStringWithNullToEmpty(organization.getWebsiteUrl())); return affMatchOrg; }  }
OrganizationConverter implements Serializable { public AffMatchOrganization convert(Organization organization) { Preconditions.checkNotNull(organization); Preconditions.checkArgument(StringUtils.isNotBlank(organization.getId())); AffMatchOrganization affMatchOrg = new AffMatchOrganization(organization.getId().toString()); String orgName = toStringWithNullToEmpty(organization.getName()); if (orgName.trim().equalsIgnoreCase("missing legal name")) { orgName = ""; } affMatchOrg.setName(orgName); affMatchOrg.setShortName(toStringWithNullToEmpty(organization.getShortName())); affMatchOrg.setCountryName(toStringWithNullToEmpty(organization.getCountryName())); affMatchOrg.setCountryCode(toStringWithNullToEmpty(organization.getCountryCode())); affMatchOrg.setWebsiteUrl(toStringWithNullToEmpty(organization.getWebsiteUrl())); return affMatchOrg; }  AffMatchOrganization convert(Organization organization); }
OrganizationConverter implements Serializable { public AffMatchOrganization convert(Organization organization) { Preconditions.checkNotNull(organization); Preconditions.checkArgument(StringUtils.isNotBlank(organization.getId())); AffMatchOrganization affMatchOrg = new AffMatchOrganization(organization.getId().toString()); String orgName = toStringWithNullToEmpty(organization.getName()); if (orgName.trim().equalsIgnoreCase("missing legal name")) { orgName = ""; } affMatchOrg.setName(orgName); affMatchOrg.setShortName(toStringWithNullToEmpty(organization.getShortName())); affMatchOrg.setCountryName(toStringWithNullToEmpty(organization.getCountryName())); affMatchOrg.setCountryCode(toStringWithNullToEmpty(organization.getCountryCode())); affMatchOrg.setWebsiteUrl(toStringWithNullToEmpty(organization.getWebsiteUrl())); return affMatchOrg; }  AffMatchOrganization convert(Organization organization);  }