Search in sources :

Example 1 with AbstractProcedureCreationContext

use of org.n52.sos.ds.procedure.AbstractProcedureCreationContext in project SOS by 52North.

the class BoundingBoxEnrichmentTest method setUp.

@Before
public void setUp() throws OwsExceptionReport {
    final SosOffering sosOffering = new SosOffering("offeringIdentifier", "offeringName");
    final Collection<SosOffering> sosOfferings = Lists.newArrayList(sosOffering);
    final Envelope envelope = new Envelope(1.0, 2.0, 3.0, 4.0);
    final ReferencedEnvelope sosEnvelope = new ReferencedEnvelope(envelope, 4326);
    Mockito.when(enrichmentMock.getSosOfferings()).thenReturn(sosOfferings);
    Mockito.when(enrichmentMock.createEnvelopeForOfferings()).thenReturn(sosEnvelope);
    final ProcedureDescriptionSettings procSettMock = Mockito.mock(ProcedureDescriptionSettings.class);
    Mockito.when(procSettMock.getLatLongUom()).thenReturn("deg");
    Mockito.when(enrichmentMock.procedureSettings()).thenReturn(procSettMock);
    Mockito.doCallRealMethod().when(enrichmentMock).enrich((AbstractSensorML) ArgumentMatchers.any());
    final GeometryHandler geomHandlerMock = Mockito.mock(GeometryHandler.class);
    final AbstractProcedureCreationContext ctxMock = Mockito.mock(AbstractProcedureCreationContext.class);
    Mockito.when(ctxMock.getGeometryHandler()).thenReturn(geomHandlerMock);
    Mockito.when(geomHandlerMock.isNorthingFirstEpsgCode(sosEnvelope.getSrid())).thenReturn(true);
    Mockito.when(enrichmentMock.getProcedureCreationContext()).thenReturn(ctxMock);
}
Also used : ReferencedEnvelope(org.n52.shetland.util.ReferencedEnvelope) GeometryHandler(org.n52.sos.util.GeometryHandler) AbstractProcedureCreationContext(org.n52.sos.ds.procedure.AbstractProcedureCreationContext) SosOffering(org.n52.shetland.ogc.sos.SosOffering) ProcedureDescriptionSettings(org.n52.sos.service.ProcedureDescriptionSettings) ReferencedEnvelope(org.n52.shetland.util.ReferencedEnvelope) SweEnvelope(org.n52.shetland.ogc.swe.SweEnvelope) Envelope(org.locationtech.jts.geom.Envelope) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 Envelope (org.locationtech.jts.geom.Envelope)1 SosOffering (org.n52.shetland.ogc.sos.SosOffering)1 SweEnvelope (org.n52.shetland.ogc.swe.SweEnvelope)1 ReferencedEnvelope (org.n52.shetland.util.ReferencedEnvelope)1 AbstractProcedureCreationContext (org.n52.sos.ds.procedure.AbstractProcedureCreationContext)1 ProcedureDescriptionSettings (org.n52.sos.service.ProcedureDescriptionSettings)1 GeometryHandler (org.n52.sos.util.GeometryHandler)1