diff --git a/klass-api/src/main/java/no/ssb/klass/api/controllers/ClassificationController.java b/klass-api/src/main/java/no/ssb/klass/api/controllers/ClassificationController.java index 46291480..2163d070 100644 --- a/klass-api/src/main/java/no/ssb/klass/api/controllers/ClassificationController.java +++ b/klass-api/src/main/java/no/ssb/klass/api/controllers/ClassificationController.java @@ -190,7 +190,8 @@ public CollectionModel ssbsections() { public KlassPagedResources classifications( // @formatter:off @RequestParam(value = "includeCodelists", defaultValue = "false") boolean includeCodelists, - @RequestParam(value = "changedSince", required = false) @DateTimeFormat(iso = ISO.DATE_TIME) Date changedSince, + @RequestParam(value = "changedSince", required = false) + @DateTimeFormat(iso = ISO.DATE_TIME, fallbackPatterns = "yyyy-MM-dd'T'HH:mm:ss.ssZ") Date changedSince, Pageable pageable, PagedResourcesAssembler assembler) { // @formatter:on diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationIntegrationTest.java index 7e34567b..ef9e328b 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationIntegrationTest.java @@ -72,8 +72,12 @@ public void restServiceListClassificationsIncludeCodelistsJSON() { @Test public void restServiceListClassificationsChangedSinceJSON() { + // Spring's DateTimeFormat parser har changed the timezone offset format from ssZ to SSSXXX. + given().port(port).accept(ContentType.JSON).param("changedSince", "2015-10-31T01:30:00.000-02:00").get(REQUEST) + .then() + .statusCode(HttpStatus.OK.value()); + given().port(port).accept(ContentType.JSON).param("changedSince", "2015-10-31T01:30:00.000-0200").get(REQUEST) -// .prettyPeek() .then() .statusCode(HttpStatus.OK.value()) .contentType(ContentType.JSON) @@ -93,6 +97,8 @@ public void restServiceListClassificationsChangedSinceJSON() { @Test public void restServiceListClassificationsXML() { + given().port(port).accept(ContentType.XML).get(REQUEST).prettyPrint(); + given().port(port).accept(ContentType.XML).get(REQUEST) // .prettyPeek() .then() diff --git a/klass-api/src/test/java/no/ssb/klass/api/dto/hal/ClassificationResourceTest.java b/klass-api/src/test/java/no/ssb/klass/api/dto/hal/ClassificationResourceTest.java index 872e7435..b0e8058a 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/dto/hal/ClassificationResourceTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/dto/hal/ClassificationResourceTest.java @@ -32,7 +32,8 @@ public void create() { // then assertEquals(name, subject.getName()); - assertEquals("http://localhost" + RestConstants.API_VERSION_V1 + "/classifications/" + id, subject.getLink("self").orElseThrow()); + assertEquals("http://localhost" + RestConstants.API_VERSION_V1 + "/classifications/" + id + + "{?language,includeFuture}", subject.getLink("self").orElseThrow().getHref()); assertEquals(0, subject.getVersions().size()); }