From b02b1331c6612864c10be491504ad6556ddc7186 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Fri, 1 Dec 2023 13:44:18 +0000 Subject: [PATCH] fix : integration test --- .../example/graphql/common/TestContainersConfig.java | 2 +- .../graphql/gql/GQLApplicationIntegrationTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/common/TestContainersConfig.java b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/common/TestContainersConfig.java index 9474ccab4..702f6bb1d 100644 --- a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/common/TestContainersConfig.java +++ b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/common/TestContainersConfig.java @@ -6,5 +6,5 @@ public interface TestContainersConfig { @ServiceConnection - PostgreSQLContainer postgreSQLContainer = new PostgreSQLContainer<>("postgres:16.0-alpine"); + PostgreSQLContainer postgreSQLContainer = new PostgreSQLContainer<>("postgres:16.1-alpine"); } diff --git a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/gql/GQLApplicationIntegrationTest.java b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/gql/GQLApplicationIntegrationTest.java index 0c37e8416..465c61862 100644 --- a/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/gql/GQLApplicationIntegrationTest.java +++ b/graphql/boot-graphql-webmvc/src/test/java/com/example/graphql/gql/GQLApplicationIntegrationTest.java @@ -8,13 +8,18 @@ import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) class GQLApplicationIntegrationTest extends AbstractIntegrationTest { @Test + @Order(1) void allAuthors() { graphQlTester .documentName("allAuthors") @@ -33,6 +38,7 @@ void allAuthors() { .hasSize(4); } + @Order(2) @ParameterizedTest @CsvSource({ "user1@example.com, first name1, last name1, Title1", @@ -67,6 +73,7 @@ void findAuthorByEmailId(String email, String firstName, String lastName, String .hasSize(3); } + @Order(3) @Test void createAuthor() { Map inputValues = new HashMap<>(); @@ -94,6 +101,7 @@ void createAuthor() { } @Test + @Order(4) void createPost() { Map inputValues = new HashMap<>(); inputValues.put("title", "JunitTitle"); @@ -129,6 +137,8 @@ void createPost() { } @Test + @Order(5) + // adding ordering to make sure others are not failed void addCommentToPost() { PostCommentRequest postCommentRequest = new PostCommentRequest("JunitTitle", "JunitContent", 1L, true);