From 628c21b9c475d80efeede3760446ff9378892404 Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Fri, 14 Jul 2023 09:27:08 +0200 Subject: [PATCH] #2019 - Prepare changelog. --- src/main/resources/changelog.txt | 9 ++ .../hateoas/support/ChangelogCreator.java | 90 +++++++++---------- 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/src/main/resources/changelog.txt b/src/main/resources/changelog.txt index 813b9c70..e37524dc 100644 --- a/src/main/resources/changelog.txt +++ b/src/main/resources/changelog.txt @@ -1,6 +1,15 @@ Spring HATEOAS Changelog ======================== +Changes in version 2.0.5 (2023-07-14) +---------------------------------------- +- #2018 - Switch to UriComponentsBuilder.fromUri(…). +- #2013 - Upgrade to Spring Framework 6.0.11. +- #2008 - Upgrade to Slf4j 2.0.7. +- #2006 - Upgrade to Reactor 2022.0.9. +- #2002 - Upgrade to Lombok 1.18.28. +- #1991 - Upgrade to Logback 1.4.8. + Changes in version 2.0.4 (2023-05-11) ---------------------------------------- - #1972 - Upgrade to Reactor 2022.0.7. diff --git a/src/test/java/org/springframework/hateoas/support/ChangelogCreator.java b/src/test/java/org/springframework/hateoas/support/ChangelogCreator.java index f0ef245d..457247a6 100644 --- a/src/test/java/org/springframework/hateoas/support/ChangelogCreator.java +++ b/src/test/java/org/springframework/hateoas/support/ChangelogCreator.java @@ -38,66 +38,66 @@ import com.jayway.jsonpath.JsonPath; */ class ChangelogCreator { - private static final int MILESTONE_ID = 117; - private static final String URI_TEMPLATE = "https://api.github.com/repos/spring-projects/spring-hateoas/issues?milestone={id}&state=closed"; + private static final int MILESTONE_ID = 119; + private static final String URI_TEMPLATE = "https://api.github.com/repos/spring-projects/spring-hateoas/issues?milestone={id}"; - public static void main(String... args) { + public static void main(String... args) { - /* - * If you run into github rate limiting issues, you can always use a Github Personal Token by adding - * {@code .header(HttpHeaders.AUTHORIZATION, "token your-github-token")} to the webClient call. - */ + /* + * If you run into github rate limiting issues, you can always use a Github Personal Token by adding + * {@code .header(HttpHeaders.AUTHORIZATION, "token your-github-token")} to the webClient call. + */ - WebClient webClient = WebClient.create(); + WebClient webClient = WebClient.create(); - HttpEntity response = webClient // - .get().uri(URI_TEMPLATE, MILESTONE_ID) // - .exchangeToMono(clientResponse -> clientResponse.toEntity(String.class)) // - .block(Duration.ofSeconds(10)); + HttpEntity response = webClient // + .get().uri(URI_TEMPLATE, MILESTONE_ID) // + .exchangeToMono(clientResponse -> clientResponse.toEntity(String.class)) // + .block(Duration.ofSeconds(10)); - boolean keepChecking = true; - boolean printHeader = true; + boolean keepChecking = true; + boolean printHeader = true; - while (keepChecking) { + while (keepChecking) { - readPage(response.getBody(), printHeader); - printHeader = false; + readPage(response.getBody(), printHeader); + printHeader = false; - List linksInHeader = response.getHeaders().get(HttpHeaders.LINK); - Links links = linksInHeader == null ? Links.NONE : Links.parse(linksInHeader.get(0)); + List linksInHeader = response.getHeaders().get(HttpHeaders.LINK); + Links links = linksInHeader == null ? Links.NONE : Links.parse(linksInHeader.get(0)); - if (links.getLink(IanaLinkRelations.NEXT).isPresent()) { + if (links.getLink(IanaLinkRelations.NEXT).isPresent()) { - response = webClient // - .get().uri(links.getRequiredLink(IanaLinkRelations.NEXT).expand().getHref()) // - .exchangeToMono(clientResponse -> clientResponse.toEntity(String.class)) // - .block(Duration.ofSeconds(10)); + response = webClient // + .get().uri(links.getRequiredLink(IanaLinkRelations.NEXT).expand().getHref()) // + .exchangeToMono(clientResponse -> clientResponse.toEntity(String.class)) // + .block(Duration.ofSeconds(10)); - } else { - keepChecking = false; - } - } - } + } else { + keepChecking = false; + } + } + } - private static void readPage(String content, boolean header) { + private static void readPage(String content, boolean header) { - JsonPath titlePath = JsonPath.compile("$[*].title"); - JsonPath idPath = JsonPath.compile("$[*].number"); + JsonPath titlePath = JsonPath.compile("$[*].title"); + JsonPath idPath = JsonPath.compile("$[*].number"); - JSONArray titles = titlePath.read(content); - Iterator ids = ((JSONArray) idPath.read(content)).iterator(); + JSONArray titles = titlePath.read(content); + Iterator ids = ((JSONArray) idPath.read(content)).iterator(); - if (header) { - System.out.println( - "Changes in version " + JsonPath.read(content, "$[0].milestone.title") + " (" + LocalDate.now() - + ")"); - System.out.println("----------------------------------------"); - } + if (header) { + System.out.println( + "Changes in version " + JsonPath.read(content, "$[0].milestone.title") + " (" + LocalDate.now() + + ")"); + System.out.println("----------------------------------------"); + } - for (Object title : titles) { + for (Object title : titles) { - String format = String.format("- #%s - %s", ids.next(), title.toString().replaceAll("`", "")); - System.out.println(format.endsWith(".") ? format : format.concat(".")); - } - } + String format = String.format("- #%s - %s", ids.next(), title.toString().replaceAll("`", "")); + System.out.println(format.endsWith(".") ? format : format.concat(".")); + } + } }