Skip to content

Commit

Permalink
fix : integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Dec 1, 2023
1 parent 34a3923 commit b02b133
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
public interface TestContainersConfig {

@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer = new PostgreSQLContainer<>("postgres:16.0-alpine");
PostgreSQLContainer<?> postgreSQLContainer = new PostgreSQLContainer<>("postgres:16.1-alpine");
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -33,6 +38,7 @@ void allAuthors() {
.hasSize(4);
}

@Order(2)
@ParameterizedTest
@CsvSource({
"[email protected], first name1, last name1, Title1",
Expand Down Expand Up @@ -67,6 +73,7 @@ void findAuthorByEmailId(String email, String firstName, String lastName, String
.hasSize(3);
}

@Order(3)
@Test
void createAuthor() {
Map<String, Object> inputValues = new HashMap<>();
Expand Down Expand Up @@ -94,6 +101,7 @@ void createAuthor() {
}

@Test
@Order(4)
void createPost() {
Map<String, Object> inputValues = new HashMap<>();
inputValues.put("title", "JunitTitle");
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b02b133

Please sign in to comment.