Skip to content

Commit

Permalink
Test different import formats.
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Chrzan <[email protected]>
Signed-off-by: mchrza <[email protected]>
  • Loading branch information
mchrza committed Oct 24, 2024
1 parent aedfab2 commit 2617e2b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.io.IOException;

import static com.here.xyz.jobs.datasets.space.UpdateStrategy.DEFAULT_UPDATE_STRATEGY;

public class ImportStepTest extends StepTest {
Expand Down Expand Up @@ -107,4 +109,39 @@ public void testImportFilesToSpaceStep() throws Exception {
StatisticsResponse statsAfter = getStatistics(SPACE_ID);
Assertions.assertEquals(Long.valueOf(FILE_COUNT * FEATURE_COUNT), statsAfter.getCount().getValue());
}

@Test
public void testImportFilesToSpaceStepWithGEOJson() throws Exception {
//Gets executed SYNC
executeImportStep(Format.GEOJSON);
}

@Test
public void testImportFilesToSpaceStepWithCSV_Json_WKB() throws Exception {
//Gets executed ASYNC
executeImportStep(Format.CSV_JSON_WKB);
}

@Test
public void testImportFilesToSpaceStepWithCSV_GeoJson() throws Exception {
//Gets executed ASYNC
executeImportStep(Format.CSV_GEOJSON);
}


private void executeImportStep(Format format) throws IOException, InterruptedException {
StatisticsResponse statsBefore = getStatistics(SPACE_ID);
Assertions.assertEquals(0L, (Object) statsBefore.getCount().getValue());

uploadFiles(JOB_ID, FILE_COUNT, FEATURE_COUNT, format);
LambdaBasedStep step = new ImportFilesToSpace()
.withFormat(format)
.withUpdateStrategy(DEFAULT_UPDATE_STRATEGY)
.withSpaceId(SPACE_ID);

sendLambdaStepRequestBlock(step);

StatisticsResponse statsAfter = getStatistics(SPACE_ID);
Assertions.assertEquals(Long.valueOf(FILE_COUNT * FEATURE_COUNT), statsAfter.getCount().getValue());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testExportSpaceToFilesStepUnfiltered() throws Exception {
public void testExportSpaceToFilesStepWithPropertyFilter() throws Exception {
String propertiesQuery = URLEncoder.encode("p.description=\"Point\"", StandardCharsets.UTF_8);
executeExportStepAndCheckResults(SPACE_ID, null, null,
PropertiesQuery.fromString(propertiesQuery), null, "/search?"+propertiesQuery);
PropertiesQuery.fromString(propertiesQuery), null, "/search?" + propertiesQuery);
}

@Test
Expand Down

0 comments on commit 2617e2b

Please sign in to comment.