CalvalusDataInputs { Map<String, String> getInputMapFormatted() { return inputMapFormatted; } CalvalusDataInputs(ExecuteRequestExtractor executeRequestExtractor,
                       WpsProcess calvalusProcessor,
                       ProductSet[] productSets,
                       CalvalusFacade calvalusFacade); String getValue(String parameterName); @Override String toString(); static final long MIN_DATE; static final long MAX_DATE; static SimpleDateFormat ISO_DATE_FORMAT; }
@Test public void canGetInputMapFormatted() throws Exception { Map<String, String> mockInputMapRaw = getProductionParametersRawMap(); when(mockExecuteRequestExtractor.getInputParametersMapRaw()).thenReturn(mockInputMapRaw); when(mockCalvalusProcessor.getDefaultSnapBundle()).thenReturn("snap-3.0.0"); when(mockCalvalusProcessor.getDefaultCalvalusBundle()).thenReturn("calvalus-2.0b411"); CalvalusFacade mockCalvalusFacade = getMockCalvalusFacade(); calvalusDataInputs = new CalvalusDataInputs(mockExecuteRequestExtractor, mockCalvalusProcessor, productSets, mockCalvalusFacade); assertThat(calvalusDataInputs.getInputMapFormatted().get("productionType"), equalTo("L2Plus")); assertThat(calvalusDataInputs.getInputMapFormatted().get("calvalus.calvalus.bundle"), equalTo("calvalus-2.0b411")); assertThat(calvalusDataInputs.getInputMapFormatted().get("calvalus.snap.bundle"), equalTo("snap-3.0.0")); assertThat(calvalusDataInputs.getInputMapFormatted().get("productionName"), equalTo("dummyProductionName")); assertThat(calvalusDataInputs.getInputMapFormatted().get("minDateSource"), equalTo("2016-01-01T01:00:00+01:00")); assertThat(calvalusDataInputs.getInputMapFormatted().get("maxDateSource"), equalTo("2017-01-01T01:00:00+01:00")); }
@Test public void canGetInputMapFormattedWithProductionSetDateRange() throws Exception { Map<String, String> mockInputMapRaw = getProductionParametersRawMap(); when(mockExecuteRequestExtractor.getInputParametersMapRaw()).thenReturn(mockInputMapRaw); when(mockCalvalusProcessor.getDefaultSnapBundle()).thenReturn("snap-3.0.0"); when(mockCalvalusProcessor.getDefaultCalvalusBundle()).thenReturn("calvalus-2.0b411"); ProductSet[] productSetsWithDateRange = getMockProductSetsWithDates(); CalvalusFacade mockCalvalusFacade = getMockCalvalusFacade(); calvalusDataInputs = new CalvalusDataInputs(mockExecuteRequestExtractor, mockCalvalusProcessor, productSetsWithDateRange, mockCalvalusFacade); assertThat(calvalusDataInputs.getInputMapFormatted().get("productionType"), equalTo("L2Plus")); assertThat(calvalusDataInputs.getInputMapFormatted().get("calvalus.calvalus.bundle"), equalTo("calvalus-2.0b411")); assertThat(calvalusDataInputs.getInputMapFormatted().get("calvalus.snap.bundle"), equalTo("snap-3.0.0")); assertThat(calvalusDataInputs.getInputMapFormatted().get("productionName"), equalTo("dummyProductionName")); assertThat(calvalusDataInputs.getInputMapFormatted().get("minDateSource"), equalTo("2000-01-01T01:00:00+01:00")); assertThat(calvalusDataInputs.getInputMapFormatted().get("maxDateSource"), equalTo("2010-01-01T01:00:00+01:00")); }
@Test public void canGetInputMapFormattedWithProductionSetGeoDb() throws Exception { Map<String, String> mockInputMapRaw = getProductionParametersRawMap(); when(mockExecuteRequestExtractor.getInputParametersMapRaw()).thenReturn(mockInputMapRaw); when(mockCalvalusProcessor.getDefaultSnapBundle()).thenReturn("snap-3.0.0"); when(mockCalvalusProcessor.getDefaultCalvalusBundle()).thenReturn("calvalus-2.10-SNAPSHOT"); ProductSet[] productSetsWithGeoDb = getMockProductSetsWithGeoDb(); CalvalusFacade mockCalvalusFacade = getMockCalvalusFacade(); calvalusDataInputs = new CalvalusDataInputs(mockExecuteRequestExtractor, mockCalvalusProcessor, productSetsWithGeoDb, mockCalvalusFacade); assertThat(calvalusDataInputs.getInputMapFormatted().get("productionType"), equalTo("L2Plus")); assertThat(calvalusDataInputs.getInputMapFormatted().get("calvalus.calvalus.bundle"), equalTo("calvalus-2.10-SNAPSHOT")); assertThat(calvalusDataInputs.getInputMapFormatted().get("calvalus.snap.bundle"), equalTo("snap-3.0.0")); assertThat(calvalusDataInputs.getInputMapFormatted().get("productionName"), equalTo("dummyProductionName")); assertThat(calvalusDataInputs.getInputMapFormatted().get("minDateSource"), equalTo("2016-01-01T01:00:00+01:00")); assertThat(calvalusDataInputs.getInputMapFormatted().get("maxDateSource"), equalTo("2017-01-01T01:00:00+01:00")); assertThat(calvalusDataInputs.getInputMapFormatted().get("geoInventory"), equalTo("/calvalus/geoInventory/URBAN_FOOTPRINT_GUF_GLOBAL_75m")); }