diff --git a/pom.xml b/pom.xml index c897772..ed62fd9 100644 --- a/pom.xml +++ b/pom.xml @@ -9,85 +9,64 @@ jar DEV-SNAPSHOT - - org.springframework.boot - spring-boot-starter-parent - 2.7.1 - - UTF-8 UTF-8 17 17 + 7.17.4 + 2.2 + 2.13.3 + 3.1 + 5.8.2 + 1.7.36 - - - - org.springframework.boot - spring-boot - 2.7.1 - pom - import - - - - com.fasterxml.jackson.core jackson-databind - 2.13.2.2 + ${jackson.databind.version} org.elasticsearch elasticsearch + ${elasticsearch.lib.version} org.elasticsearch.client elasticsearch-rest-high-level-client + ${elasticsearch.lib.version} org.hamcrest hamcrest-library - 2.2 - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - compile + ${hamcrest.version} com.tdunning t-digest - 3.1 + ${t-digest.version} - org.testcontainers - testcontainers - 1.15.1 + org.slf4j + slf4j-simple + ${slf4j.version} - org.testcontainers - elasticsearch - 1.15.1 + org.junit.jupiter + junit-jupiter + ${junit.version} + test - - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + - diff --git a/src/main/java/no/difi/statistics/test/utils/MockMvcRequests.java b/src/main/java/no/difi/statistics/test/utils/MockMvcRequests.java deleted file mode 100644 index 6b924ba..0000000 --- a/src/main/java/no/difi/statistics/test/utils/MockMvcRequests.java +++ /dev/null @@ -1,71 +0,0 @@ -package no.difi.statistics.test.utils; - -import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; - -import static org.apache.commons.codec.binary.Base64.encodeBase64; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import org.springframework.http.MediaType; - -public class MockMvcRequests { - - public static RequestBuilder request() { - return new RequestBuilder(); - } - - public static class RequestBuilder { - private String owner = "aUser"; - private String series = "aTimeSeries"; - private String user = "aUser"; - private String password = "aPassword"; - private String content; - private String distance; - - public RequestBuilder owner(String owner) { - this.owner = owner; - return this; - } - - public RequestBuilder series(String series) { - this.series = series; - return this; - } - - public RequestBuilder user(String user) { - this.user = user; - return this; - } - - public RequestBuilder password(String password) { - this.password = password; - return this; - } - - public RequestBuilder content(String content) { - this.content = content; - return this; - } - - public RequestBuilder distance(String distance) { - this.distance = distance; - return this; - } - - private String authorizationHeader(String username, String password) { - return "Basic " + new String(encodeBase64((username + ":" + password).getBytes())); - } - - public MockHttpServletRequestBuilder ingest() { - return post("/{owner}/{seriesName}/{distance}", owner, series, distance) - .contentType(MediaType.APPLICATION_JSON_UTF8) - .header("Authorization", authorizationHeader(user, password)) - .content(content); - } - - public MockHttpServletRequestBuilder last() { - return get("/{owner}/{seriesName}/{distance}/last", owner, series, distance); - } - - } - -}