@Test public void buildObject_organization_metadata_name_empty() throws Exception { eu.dnetlib.dhp.schema.oaf.Organization organization = createEmptyOafObject(); assertNull(converter.convert(organization)); verify(log).error("skipping: empty organization name"); }
@Override public Organization convert(eu.dnetlib.dhp.schema.oaf.Organization srcOrganization) { Preconditions.checkNotNull(srcOrganization); if (!isDataCorrect(srcOrganization)) { return null; } Organization.Builder orgBuilder = Organization.newBuilder(); orgBuilder.setId(srcOrganization.getId()); orgBuilder.setName(srcOrganization.getLegalname().getValue()); orgBuilder.setShortName(srcOrganization.getLegalshortname() != null ? srcOrganization.getLegalshortname().getValue() : null); orgBuilder.setCountryName(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassname() : null); orgBuilder.setCountryCode(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassid() : null); orgBuilder.setWebsiteUrl(srcOrganization.getWebsiteurl() != null ? srcOrganization.getWebsiteurl().getValue(): null); return orgBuilder.build(); }
OrganizationConverter implements OafEntityToAvroConverter<eu.dnetlib.dhp.schema.oaf.Organization, Organization> { @Override public Organization convert(eu.dnetlib.dhp.schema.oaf.Organization srcOrganization) { Preconditions.checkNotNull(srcOrganization); if (!isDataCorrect(srcOrganization)) { return null; } Organization.Builder orgBuilder = Organization.newBuilder(); orgBuilder.setId(srcOrganization.getId()); orgBuilder.setName(srcOrganization.getLegalname().getValue()); orgBuilder.setShortName(srcOrganization.getLegalshortname() != null ? srcOrganization.getLegalshortname().getValue() : null); orgBuilder.setCountryName(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassname() : null); orgBuilder.setCountryCode(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassid() : null); orgBuilder.setWebsiteUrl(srcOrganization.getWebsiteurl() != null ? srcOrganization.getWebsiteurl().getValue(): null); return orgBuilder.build(); } }
OrganizationConverter implements OafEntityToAvroConverter<eu.dnetlib.dhp.schema.oaf.Organization, Organization> { @Override public Organization convert(eu.dnetlib.dhp.schema.oaf.Organization srcOrganization) { Preconditions.checkNotNull(srcOrganization); if (!isDataCorrect(srcOrganization)) { return null; } Organization.Builder orgBuilder = Organization.newBuilder(); orgBuilder.setId(srcOrganization.getId()); orgBuilder.setName(srcOrganization.getLegalname().getValue()); orgBuilder.setShortName(srcOrganization.getLegalshortname() != null ? srcOrganization.getLegalshortname().getValue() : null); orgBuilder.setCountryName(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassname() : null); orgBuilder.setCountryCode(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassid() : null); orgBuilder.setWebsiteUrl(srcOrganization.getWebsiteurl() != null ? srcOrganization.getWebsiteurl().getValue(): null); return orgBuilder.build(); }  }
OrganizationConverter implements OafEntityToAvroConverter<eu.dnetlib.dhp.schema.oaf.Organization, Organization> { @Override public Organization convert(eu.dnetlib.dhp.schema.oaf.Organization srcOrganization) { Preconditions.checkNotNull(srcOrganization); if (!isDataCorrect(srcOrganization)) { return null; } Organization.Builder orgBuilder = Organization.newBuilder(); orgBuilder.setId(srcOrganization.getId()); orgBuilder.setName(srcOrganization.getLegalname().getValue()); orgBuilder.setShortName(srcOrganization.getLegalshortname() != null ? srcOrganization.getLegalshortname().getValue() : null); orgBuilder.setCountryName(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassname() : null); orgBuilder.setCountryCode(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassid() : null); orgBuilder.setWebsiteUrl(srcOrganization.getWebsiteurl() != null ? srcOrganization.getWebsiteurl().getValue(): null); return orgBuilder.build(); }  @Override Organization convert(eu.dnetlib.dhp.schema.oaf.Organization srcOrganization); }
OrganizationConverter implements OafEntityToAvroConverter<eu.dnetlib.dhp.schema.oaf.Organization, Organization> { @Override public Organization convert(eu.dnetlib.dhp.schema.oaf.Organization srcOrganization) { Preconditions.checkNotNull(srcOrganization); if (!isDataCorrect(srcOrganization)) { return null; } Organization.Builder orgBuilder = Organization.newBuilder(); orgBuilder.setId(srcOrganization.getId()); orgBuilder.setName(srcOrganization.getLegalname().getValue()); orgBuilder.setShortName(srcOrganization.getLegalshortname() != null ? srcOrganization.getLegalshortname().getValue() : null); orgBuilder.setCountryName(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassname() : null); orgBuilder.setCountryCode(srcOrganization.getCountry() != null ? srcOrganization.getCountry().getClassid() : null); orgBuilder.setWebsiteUrl(srcOrganization.getWebsiteurl() != null ? srcOrganization.getWebsiteurl().getValue(): null); return orgBuilder.build(); }  @Override Organization convert(eu.dnetlib.dhp.schema.oaf.Organization srcOrganization);  }