@Test public void test_should_not_convert_city_if_null() { Tenant tenantContract = Tenant.builder() .code("AP.KURNOOL") .name("kurnool") .description("description") .logoId("logoId") .imageId("imageId") .domainUrl("domainUrl") .type("CITY") .twitterUrl("twitterUrl") .facebookUrl("faceBookUrl") .emailId("email") .address("address") .contactNumber("contactNumber") .helpLineNumber("helpLineNumber") .city(null) .build(); org.egov.tenant.domain.model.Tenant actualTenantModel = tenantContract.toDomain(); assertThat(actualTenantModel.getCity()).isNull(); }
@JsonIgnore public org.egov.tenant.domain.model.Tenant toDomain() { org.egov.tenant.domain.model.City city; if (this.city != null) { city = this.city.toDomain(); } else { city = null; } return org.egov.tenant.domain.model.Tenant.builder() .code(code) .name(name) .description(description) .logoId(logoId) .imageId(imageId) .domainUrl(domainUrl) .type(type) .twitterUrl(twitterUrl) .facebookUrl(facebookUrl) .emailId(emailId) .address(address) .contactNumber(contactNumber) .helpLineNumber(helpLineNumber) .city(city) .build(); }
Tenant { @JsonIgnore public org.egov.tenant.domain.model.Tenant toDomain() { org.egov.tenant.domain.model.City city; if (this.city != null) { city = this.city.toDomain(); } else { city = null; } return org.egov.tenant.domain.model.Tenant.builder() .code(code) .name(name) .description(description) .logoId(logoId) .imageId(imageId) .domainUrl(domainUrl) .type(type) .twitterUrl(twitterUrl) .facebookUrl(facebookUrl) .emailId(emailId) .address(address) .contactNumber(contactNumber) .helpLineNumber(helpLineNumber) .city(city) .build(); } }
Tenant { @JsonIgnore public org.egov.tenant.domain.model.Tenant toDomain() { org.egov.tenant.domain.model.City city; if (this.city != null) { city = this.city.toDomain(); } else { city = null; } return org.egov.tenant.domain.model.Tenant.builder() .code(code) .name(name) .description(description) .logoId(logoId) .imageId(imageId) .domainUrl(domainUrl) .type(type) .twitterUrl(twitterUrl) .facebookUrl(facebookUrl) .emailId(emailId) .address(address) .contactNumber(contactNumber) .helpLineNumber(helpLineNumber) .city(city) .build(); } Tenant(org.egov.tenant.domain.model.Tenant tenant, City city); }
Tenant { @JsonIgnore public org.egov.tenant.domain.model.Tenant toDomain() { org.egov.tenant.domain.model.City city; if (this.city != null) { city = this.city.toDomain(); } else { city = null; } return org.egov.tenant.domain.model.Tenant.builder() .code(code) .name(name) .description(description) .logoId(logoId) .imageId(imageId) .domainUrl(domainUrl) .type(type) .twitterUrl(twitterUrl) .facebookUrl(facebookUrl) .emailId(emailId) .address(address) .contactNumber(contactNumber) .helpLineNumber(helpLineNumber) .city(city) .build(); } Tenant(org.egov.tenant.domain.model.Tenant tenant, City city); @JsonIgnore org.egov.tenant.domain.model.Tenant toDomain(); }
Tenant { @JsonIgnore public org.egov.tenant.domain.model.Tenant toDomain() { org.egov.tenant.domain.model.City city; if (this.city != null) { city = this.city.toDomain(); } else { city = null; } return org.egov.tenant.domain.model.Tenant.builder() .code(code) .name(name) .description(description) .logoId(logoId) .imageId(imageId) .domainUrl(domainUrl) .type(type) .twitterUrl(twitterUrl) .facebookUrl(facebookUrl) .emailId(emailId) .address(address) .contactNumber(contactNumber) .helpLineNumber(helpLineNumber) .city(city) .build(); } Tenant(org.egov.tenant.domain.model.Tenant tenant, City city); @JsonIgnore org.egov.tenant.domain.model.Tenant toDomain();  }