Search in sources :

Example 6 with FluxReportIdentifierEntity

use of eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityMatchingIdsServiceBeanTest method getMockedIdentifiers.

private List<FluxReportIdentifierEntity> getMockedIdentifiers() {
    FluxReportIdentifierEntity ident1 = new FluxReportIdentifierEntity();
    FluxReportIdentifierEntity ident2 = new FluxReportIdentifierEntity();
    ident1.setFluxReportIdentifierId("46DCC44C-0AE2-434C-BC14-B85D86B29512iiiii");
    ident1.setFluxReportIdentifierSchemeId("scheme-idvv");
    ident1.setFluxReportIdentifierId("46DCC44C-0AE2-434C-BC14-B85D86B29512bbbbb");
    ident1.setFluxReportIdentifierSchemeId("scheme-idqq");
    return Arrays.asList(ident1, ident2);
}
Also used : FluxReportIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity)

Example 7 with FluxReportIdentifierEntity

use of eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class FaReportDocumentMapperTest method testMapToFaReportCorrection.

@Test
public void testMapToFaReportCorrection() {
    FaReportDocumentEntity faReportDocumentEntity = MapperUtil.getFaReportDocumentEntity();
    FaReportCorrectionDTO faReportCorrectionDTO = FaReportDocumentMapper.INSTANCE.mapToFaReportCorrectionDto(faReportDocumentEntity);
    assertEquals(faReportDocumentEntity.getStatus(), faReportCorrectionDTO.getCorrectionType());
    assertEquals(faReportDocumentEntity.getFluxReportDocument().getCreationDatetime(), faReportCorrectionDTO.getCreationDate());
    FluxReportIdentifierEntity entity = faReportDocumentEntity.getFluxReportDocument().getFluxReportIdentifiers().iterator().next();
    assertEquals(entity.getFluxReportIdentifierId(), faReportCorrectionDTO.getFaReportIdentifiers().entrySet().iterator().next().getKey());
    assertEquals(entity.getFluxReportIdentifierSchemeId(), faReportCorrectionDTO.getFaReportIdentifiers().entrySet().iterator().next().getValue());
    assertEquals(faReportDocumentEntity.getFluxReportDocument().getFluxParty().getFluxPartyName(), faReportCorrectionDTO.getOwnerFluxPartyName());
}
Also used : FluxReportIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity) FaReportDocumentEntity(eu.europa.ec.fisheries.ers.fa.entities.FaReportDocumentEntity) FaReportCorrectionDTO(eu.europa.ec.fisheries.ers.service.dto.fareport.FaReportCorrectionDTO) Test(org.junit.Test)

Example 8 with FluxReportIdentifierEntity

use of eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class FaReportDocumentMapperTest method testMapToFaReportCorrectionList.

@Test
public void testMapToFaReportCorrectionList() {
    FaReportDocumentEntity faReportDocumentEntity = MapperUtil.getFaReportDocumentEntity();
    List<FaReportCorrectionDTO> faReportCorrectionDTOs = FaReportDocumentMapper.INSTANCE.mapToFaReportCorrectionDtoList(Arrays.asList(faReportDocumentEntity));
    FaReportCorrectionDTO faReportCorrectionDTO = faReportCorrectionDTOs.get(0);
    assertEquals(faReportDocumentEntity.getStatus(), faReportCorrectionDTO.getCorrectionType());
    assertEquals(faReportDocumentEntity.getFluxReportDocument().getCreationDatetime(), faReportCorrectionDTO.getCreationDate());
    FluxReportIdentifierEntity entity = faReportDocumentEntity.getFluxReportDocument().getFluxReportIdentifiers().iterator().next();
    assertEquals(entity.getFluxReportIdentifierId(), faReportCorrectionDTO.getFaReportIdentifiers().entrySet().iterator().next().getKey());
    assertEquals(entity.getFluxReportIdentifierSchemeId(), faReportCorrectionDTO.getFaReportIdentifiers().entrySet().iterator().next().getValue());
    assertEquals(faReportDocumentEntity.getFluxReportDocument().getFluxParty().getFluxPartyName(), faReportCorrectionDTO.getOwnerFluxPartyName());
}
Also used : FluxReportIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity) FaReportDocumentEntity(eu.europa.ec.fisheries.ers.fa.entities.FaReportDocumentEntity) FaReportCorrectionDTO(eu.europa.ec.fisheries.ers.service.dto.fareport.FaReportCorrectionDTO) Test(org.junit.Test)

Example 9 with FluxReportIdentifierEntity

use of eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFluxReportDocumentEntity.

public static FluxReportDocumentEntity getFluxReportDocumentEntity() {
    FluxReportDocumentEntity fluxReportDocumentEntity = new FluxReportDocumentEntity();
    fluxReportDocumentEntity.setCreationDatetime(new Date());
    fluxReportDocumentEntity.setFluxReportIdentifiers(new HashSet<FluxReportIdentifierEntity>(Arrays.asList(getFluxReportIdentifierEntity())));
    fluxReportDocumentEntity.setFluxParty(getFluxPartyEntity());
    fluxReportDocumentEntity.setPurpose("Test purpose");
    fluxReportDocumentEntity.setPurposeCode("5");
    fluxReportDocumentEntity.setPurposeCodeListId("57thf-58fj88-4d9834-thdue");
    fluxReportDocumentEntity.setReferenceId("Ref Id 1");
    return fluxReportDocumentEntity;
}
Also used : FluxReportIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity) FluxReportDocumentEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxReportDocumentEntity) Date(java.util.Date)

Example 10 with FluxReportIdentifierEntity

use of eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFluxReportIdentifierEntity.

public static FluxReportIdentifierEntity getFluxReportIdentifierEntity() {
    FluxReportIdentifierEntity fluxReportIdentifierEntity = new FluxReportIdentifierEntity();
    fluxReportIdentifierEntity.setFluxReportIdentifierId("Report Id 1");
    fluxReportIdentifierEntity.setFluxReportIdentifierSchemeId("Scheme Id 1");
    return fluxReportIdentifierEntity;
}
Also used : FluxReportIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity)

Aggregations

FluxReportIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxReportIdentifierEntity)10 FluxReportDocumentEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxReportDocumentEntity)3 Test (org.junit.Test)3 FaReportDocumentEntity (eu.europa.ec.fisheries.ers.fa.entities.FaReportDocumentEntity)2 FluxPartyEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxPartyEntity)2 FaReportCorrectionDTO (eu.europa.ec.fisheries.ers.service.dto.fareport.FaReportCorrectionDTO)2 ArrayList (java.util.ArrayList)2 FluxPartyIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxPartyIdentifierEntity)1 FluxReportIdentifierDTO (eu.europa.ec.fisheries.ers.service.dto.FluxReportIdentifierDTO)1 ActivityIDType (eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityIDType)1 ActivityUniquinessList (eu.europa.ec.fisheries.uvms.activity.model.schemas.ActivityUniquinessList)1 Date (java.util.Date)1 HashSet (java.util.HashSet)1 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)1