Skip to content

Commit

Permalink
Corrected failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikos Paraskevopoulos authored and Nikos Paraskevopoulos committed Dec 14, 2020
1 parent d99400d commit c13d500
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The
import eu.europa.ec.fisheries.schema.rules.exchange.v1.PluginType;
import eu.europa.ec.fisheries.schema.rules.module.v1.SetFLUXMovementReportRequest;
import eu.europa.ec.fisheries.schema.rules.previous.v1.PreviousReportType;
import eu.europa.ec.fisheries.schema.rules.rule.v1.RawMsgType;
import eu.europa.ec.fisheries.schema.rules.search.v1.AlarmQuery;
import eu.europa.ec.fisheries.schema.rules.search.v1.TicketQuery;
import eu.europa.ec.fisheries.schema.rules.source.v1.GetAlarmListByQueryResponse;
Expand All @@ -42,8 +43,11 @@ This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The
import eu.europa.ec.fisheries.uvms.rules.model.dto.TicketListResponseDto;
import eu.europa.ec.fisheries.uvms.rules.model.mapper.RulesDataSourceRequestMapper;
import eu.europa.ec.fisheries.uvms.rules.model.mapper.RulesDataSourceResponseMapper;
import eu.europa.ec.fisheries.uvms.rules.service.bean.RulePostProcessBean;
import eu.europa.ec.fisheries.uvms.rules.service.bean.RulesEngineBean;
import eu.europa.ec.fisheries.uvms.rules.service.bean.mdr.MDRCache;
import eu.europa.ec.fisheries.uvms.rules.service.business.PreviousReportFact;
import eu.europa.ec.fisheries.uvms.rules.service.business.ValidationResult;
import eu.europa.ec.fisheries.uvms.rules.service.constants.MDRAcronymType;
import eu.europa.ec.fisheries.uvms.rules.service.constants.ServiceConstants;
import org.junit.Before;
Expand All @@ -60,9 +64,11 @@ This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The
import un.unece.uncefact.data.standard.fluxvesselpositionmessage._4.FLUXVesselPositionMessage;
import un.unece.uncefact.data.standard.mdr.communication.ColumnDataType;
import un.unece.uncefact.data.standard.mdr.communication.ObjectRepresentation;
import un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._18.FLUXReportDocumentType;
import un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._18.VesselPositionEventType;
import un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._18.VesselTransportMeansType;
import un.unece.uncefact.data.standard.unqualifieddatatype._18.CodeType;
import un.unece.uncefact.data.standard.unqualifieddatatype._18.IDType;

import javax.enterprise.event.Event;
import javax.jms.JMSException;
Expand All @@ -89,6 +95,7 @@ This file is part of the Integrated Fisheries Data Management (IFDM) Suite. The
public class RulesMovementProcessorBeanTest {

private static final String USERNAME = "USERNAME";
private static final String FLUX_REPORT_DOC_UUID = UUID.randomUUID().toString();

@Mock
RulesMessageProducer mockProducer;
Expand All @@ -112,6 +119,10 @@ public class RulesMovementProcessorBeanTest {
MDRCache mdrCache;
@Mock
RulesExchangeProducerBean exchangeProducer;
@Mock
RulesEngineBean rulesEngine;
@Mock
RulePostProcessBean rulePostProcessBean;

@InjectMocks
RulesMovementProcessorBean rulesMovementProcessorBean;
Expand Down Expand Up @@ -546,6 +557,9 @@ public void testSetMovementReportReceived() throws Exception {
setupMobileTerminalConversation();
setupMovementModuleConversation();
String messageGuid = UUID.randomUUID().toString();
ValidationResult validationResult = new ValidationResult();
validationResult.setError(false);
when(rulePostProcessBean.checkAndUpdateValidationResult(any(), anyString(), anyString(), eq(RawMsgType.MOVEMENT))).thenReturn(validationResult);

rulesMovementProcessorBean.setMovementReportReceived(request, messageGuid);

Expand Down Expand Up @@ -577,6 +591,12 @@ private void setupFluxVesselPositionMessage(SetFLUXMovementReportRequest request
vesselPositionEvent.setTypeCode(new CodeType());
vesselPositionEvent.getTypeCode().setValue("MANUAL");
vesselTransportMeans.getSpecifiedVesselPositionEvents().add(vesselPositionEvent);
FLUXReportDocumentType fluxReportDoc = new FLUXReportDocumentType();
final IDType id = new IDType();
id.setSchemeID("UUID");
id.setValue(FLUX_REPORT_DOC_UUID);
fluxReportDoc.getIDS().add(id);
fluxVesselPositionMessage.setFLUXReportDocument(fluxReportDoc);
request.setRequest(JAXBUtils.marshallJaxBObjectToString(fluxVesselPositionMessage, "UTF-8", true));
}

Expand Down

0 comments on commit c13d500

Please sign in to comment.