use of eu.europa.ec.fisheries.ers.service.dto.fareport.details.AddressDetailsDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class StructuredAddressMapperTest method testStructuredAddressDetailsDTOListMapper.
@Test
public void testStructuredAddressDetailsDTOListMapper() {
StructuredAddress structuredAddress = MapperUtil.getStructuredAddress();
StructuredAddressEntity structuredAddressEntity = new StructuredAddressEntity();
StructuredAddressTypeEnum structuredAddressTypeEnum = StructuredAddressTypeEnum.FLUX_PHYSICAL;
FluxLocationEntity fluxLocationEntity = null;
StructuredAddressMapper.INSTANCE.mapToStructuredAddress(structuredAddress, structuredAddressTypeEnum, fluxLocationEntity, structuredAddressEntity);
List<AddressDetailsDTO> addressDetailsDTO = new ArrayList<>(StructuredAddressMapper.INSTANCE.mapToAddressDetailsDTOList(new HashSet<>(Arrays.asList(structuredAddressEntity))));
assertEquals(structuredAddressEntity.getAddressId(), addressDetailsDTO.get(0).getAddressId());
assertEquals(structuredAddressEntity.getBlockName(), addressDetailsDTO.get(0).getBlockName());
assertEquals(structuredAddressEntity.getBuildingName(), addressDetailsDTO.get(0).getBuildingName());
assertEquals(structuredAddressEntity.getCityName(), addressDetailsDTO.get(0).getCityName());
assertEquals(structuredAddressEntity.getCitySubdivisionName(), addressDetailsDTO.get(0).getCitySubdivisionName());
assertEquals(structuredAddressEntity.getCountry(), addressDetailsDTO.get(0).getCountry());
assertEquals(structuredAddressEntity.getCountryName(), addressDetailsDTO.get(0).getCountryName());
assertEquals(structuredAddressEntity.getCountrySubdivisionName(), addressDetailsDTO.get(0).getCountrySubdivisionName());
assertEquals(structuredAddressEntity.getPlotId(), addressDetailsDTO.get(0).getPlotId());
assertEquals(structuredAddressEntity.getPostcode(), addressDetailsDTO.get(0).getPostcode());
assertEquals(structuredAddressEntity.getPostOfficeBox(), addressDetailsDTO.get(0).getPostOfficeBox());
assertEquals(structuredAddressEntity.getStreetName(), addressDetailsDTO.get(0).getStreetName());
}
use of eu.europa.ec.fisheries.ers.service.dto.fareport.details.AddressDetailsDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class StructuredAddressMapperTest method testStructuredAddressDetailsDTOMapper.
@Test
public void testStructuredAddressDetailsDTOMapper() {
StructuredAddress structuredAddress = MapperUtil.getStructuredAddress();
StructuredAddressEntity structuredAddressEntity = new StructuredAddressEntity();
StructuredAddressTypeEnum structuredAddressTypeEnum = StructuredAddressTypeEnum.FLUX_PHYSICAL;
FluxLocationEntity fluxLocationEntity = null;
StructuredAddressMapper.INSTANCE.mapToStructuredAddress(structuredAddress, structuredAddressTypeEnum, fluxLocationEntity, structuredAddressEntity);
AddressDetailsDTO addressDetailsDTO = StructuredAddressMapper.INSTANCE.mapToAddressDetailsDTO(structuredAddressEntity);
assertEquals(structuredAddressEntity.getAddressId(), addressDetailsDTO.getAddressId());
assertEquals(structuredAddressEntity.getBlockName(), addressDetailsDTO.getBlockName());
assertEquals(structuredAddressEntity.getBuildingName(), addressDetailsDTO.getBuildingName());
assertEquals(structuredAddressEntity.getCityName(), addressDetailsDTO.getCityName());
assertEquals(structuredAddressEntity.getCitySubdivisionName(), addressDetailsDTO.getCitySubdivisionName());
assertEquals(structuredAddressEntity.getCountry(), addressDetailsDTO.getCountry());
assertEquals(structuredAddressEntity.getCountryName(), addressDetailsDTO.getCountryName());
assertEquals(structuredAddressEntity.getCountrySubdivisionName(), addressDetailsDTO.getCountrySubdivisionName());
assertEquals(structuredAddressEntity.getPlotId(), addressDetailsDTO.getPlotId());
assertEquals(structuredAddressEntity.getPostcode(), addressDetailsDTO.getPostcode());
assertEquals(structuredAddressEntity.getPostOfficeBox(), addressDetailsDTO.getPostOfficeBox());
assertEquals(structuredAddressEntity.getStreetName(), addressDetailsDTO.getStreetName());
}
use of eu.europa.ec.fisheries.ers.service.dto.fareport.details.AddressDetailsDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class FluxLocationMapperTest method getPhysicalAddressDetailsTest.
@Test
public void getPhysicalAddressDetailsTest() {
FluxLocationEntity fluxLocationEntity = getFluxLocationEntityMock();
AddressDetailsDTO fluxLocationDTO = FluxLocationMapper.INSTANCE.getPhysicalAddressDetails(fluxLocationEntity.getStructuredAddresses());
assertNotNull(fluxLocationDTO);
assertTrue(StringUtils.isNotEmpty(fluxLocationDTO.getBlockName()));
}
use of eu.europa.ec.fisheries.ers.service.dto.fareport.details.AddressDetailsDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class FluxLocationMapperTest method getPostalAddressDetailsTest.
@Test
public void getPostalAddressDetailsTest() {
FluxLocationEntity fluxLocationEntity = getFluxLocationEntityMock();
List<AddressDetailsDTO> fluxLocationDTO = FluxLocationMapper.INSTANCE.getPostalAddressDetails(fluxLocationEntity.getStructuredAddresses());
assertNotNull(fluxLocationDTO);
assertTrue(fluxLocationDTO.size() > 0);
}
Aggregations