Skip to content

Commit

Permalink
Fix changes in Spring HATEOAS
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaar, Bjørn-Andre committed Dec 18, 2023
1 parent 76de7f7 commit 219d001
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ public CollectionModel<SsbSectionResource> ssbsections() {
public KlassPagedResources<ClassificationSummaryResource> 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<ClassificationSeries> assembler) {
// @formatter:on

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit 219d001

Please sign in to comment.