Skip to content

Commit

Permalink
polish: renames and upgrade to postgres 16
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Sep 29, 2023
1 parent 535a6fd commit 0432fb5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.List;
import java.util.Objects;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.ProblemDetail;
Expand All @@ -12,7 +14,8 @@
import org.springframework.web.bind.annotation.ResponseStatus;

@ControllerAdvice
public class ErrorDetailProblemHandlingControllerAdvice {
@Order(Ordered.HIGHEST_PRECEDENCE)
public class GlobalExceptionHandler {

@ExceptionHandler(MethodArgumentNotValidException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class TestApplication {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>("postgres:15.3-alpine")
return new PostgreSQLContainer<>("postgres:16.0-alpine")
.withCopyFileToContainer(
MountableFile.forClasspathResource("init.sql"),
"/docker-entrypoint-initdb.d/init.sql");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.example.jooq.r2dbc;
package com.example.jooq.r2dbc.router;

import static org.assertj.core.api.Assertions.assertThat;

import com.example.jooq.r2dbc.common.AbstractIntegrationTest;
import java.util.List;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

class ApplicationIntegrationTest extends AbstractIntegrationTest {
class WebRouterConfigIT extends AbstractIntegrationTest {

@Test
void willLoadPosts() {
Expand All @@ -17,8 +18,6 @@ void willLoadPosts() {
.is2xxSuccessful()
.expectBody()
.jsonPath("$[*].title")
.value(
(List<String> titles) ->
Assertions.assertThat(titles).containsAnyOf("jooq test"));
.value((List<String> titles) -> assertThat(titles).containsAnyOf("jooq test"));
}
}

0 comments on commit 0432fb5

Please sign in to comment.