Skip to content

Commit

Permalink
add test mvt,mvtf (heremaps#1241)
Browse files Browse the repository at this point in the history
Signed-off-by: qGYdXbY2 <[email protected]>
  • Loading branch information
qGYdXbY2 authored Mar 25, 2024
1 parent 6d7fb70 commit 7b32ba4
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
package com.here.xyz.hub.rest;

import static com.here.xyz.util.service.BaseHttpServerVerticle.HeaderValues.APPLICATION_GEO_JSON;
import static com.here.xyz.util.service.BaseHttpServerVerticle.HeaderValues.APPLICATION_VND_MAPBOX_VECTOR_TILE;
import static io.netty.handler.codec.http.HttpResponseStatus.BAD_REQUEST;
import static io.netty.handler.codec.http.HttpResponseStatus.OK;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

import java.sql.Connection;
import java.sql.DriverManager;
Expand Down Expand Up @@ -164,6 +167,34 @@ public void readByTileWithVizSamplingLow() {
body("features.size()", equalTo(30000));
}

@Test
public void readByTileWithVizSamplingLowAsMvt() {
byte[] mvt =
given().
accept(APPLICATION_VND_MAPBOX_VECTOR_TILE).
headers(getAuthHeaders(AuthProfile.ACCESS_ALL)).
when().
get(getSpacesPath() + "/" + SPACE_ID + "/tile/web/5_17_10?skipCache=true&mode=viz&vizSampling=low").
then().
statusCode(OK.code()).extract().asByteArray();

assertThat(mvt.length, is(1093529));
}

@Test
public void readByTileWithVizSamplingLowAsMvtFlat() {
byte[] mvt =
given().
accept("application/octet-stream").
headers(getAuthHeaders(AuthProfile.ACCESS_ALL)).
when().
get(getSpacesPath() + "/" + SPACE_ID + "/tile/web/5_17_10.mvtf?skipCache=true&mode=viz&vizSampling=low").
then().
statusCode(OK.code()).extract().asByteArray();

assertThat(mvt.length, is(1093540));
}

@Test
public void readByTileWithVizSamplingHigh() {
given().
Expand Down

0 comments on commit 7b32ba4

Please sign in to comment.