From 5b59902cb254becc9521689d8a01c3d184f941b2 Mon Sep 17 00:00:00 2001 From: Kyle Doyle Date: Thu, 16 Apr 2020 09:55:40 -0400 Subject: [PATCH 1/8] Removed rest of project --- aws-app-sync/pom.xml | 49 +++++++++++++++++++ .../awsappsync/AwsAppSyncApplication.java | 13 +++++ .../src/main/resources/application.properties | 1 + .../AwsAppSyncApplicationTests.java | 13 +++++ 4 files changed, 76 insertions(+) create mode 100644 aws-app-sync/pom.xml create mode 100644 aws-app-sync/src/main/java/com/baeldung/awsappsync/AwsAppSyncApplication.java create mode 100644 aws-app-sync/src/main/resources/application.properties create mode 100644 aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java diff --git a/aws-app-sync/pom.xml b/aws-app-sync/pom.xml new file mode 100644 index 0000000000..af02307e66 --- /dev/null +++ b/aws-app-sync/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.2.6.RELEASE + + + com.baeldung + aws-app-sync + 0.0.1-SNAPSHOT + aws-app-sync + Demo project for Spring Boot using AWS App Sync + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/aws-app-sync/src/main/java/com/baeldung/awsappsync/AwsAppSyncApplication.java b/aws-app-sync/src/main/java/com/baeldung/awsappsync/AwsAppSyncApplication.java new file mode 100644 index 0000000000..ae012c91a5 --- /dev/null +++ b/aws-app-sync/src/main/java/com/baeldung/awsappsync/AwsAppSyncApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.awsappsync; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class AwsAppSyncApplication { + + public static void main(String[] args) { + SpringApplication.run(AwsAppSyncApplication.class, args); + } + +} diff --git a/aws-app-sync/src/main/resources/application.properties b/aws-app-sync/src/main/resources/application.properties new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/aws-app-sync/src/main/resources/application.properties @@ -0,0 +1 @@ + diff --git a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java new file mode 100644 index 0000000000..7b82393865 --- /dev/null +++ b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java @@ -0,0 +1,13 @@ +package com.baeldung.awsappsync; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class AwsAppSyncApplicationTests { + + @Test + void contextLoads() { + } + +} From 6bf0d97d62bdfe986fde782544d47ebba9cb9705 Mon Sep 17 00:00:00 2001 From: Kyle Doyle Date: Fri, 17 Apr 2020 19:50:36 -0400 Subject: [PATCH 2/8] Bael-3893 AWS AppSync with Spring Boot --- aws-app-sync/pom.xml | 15 +++- .../src/main/resources/application.properties | 1 - .../AwsAppSyncApplicationTests.java | 90 ++++++++++++++++++- 3 files changed, 102 insertions(+), 4 deletions(-) delete mode 100644 aws-app-sync/src/main/resources/application.properties diff --git a/aws-app-sync/pom.xml b/aws-app-sync/pom.xml index af02307e66..d30cfc96a4 100644 --- a/aws-app-sync/pom.xml +++ b/aws-app-sync/pom.xml @@ -8,17 +8,26 @@ 2.2.6.RELEASE + com.baeldung aws-app-sync 0.0.1-SNAPSHOT aws-app-sync - Demo project for Spring Boot using AWS App Sync + + Spring Boot using AWS App Sync 1.8 + + + com.amazonaws + aws-java-sdk-appsync + 1.11.762 + + org.springframework.boot spring-boot-starter-web @@ -35,6 +44,10 @@ + + org.springframework.boot + spring-boot-starter-webflux + diff --git a/aws-app-sync/src/main/resources/application.properties b/aws-app-sync/src/main/resources/application.properties deleted file mode 100644 index 8b13789179..0000000000 --- a/aws-app-sync/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java index 7b82393865..15bcc6e9c9 100644 --- a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java +++ b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java @@ -1,13 +1,99 @@ package com.baeldung.awsappsync; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.WebClient; + +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; @SpringBootTest class AwsAppSyncApplicationTests { - @Test - void contextLoads() { + static String apiUrl = "https://m4i3b6icrrb7livfbypfspiifi.appsync-api.us-east-2.amazonaws.com"; + static String apiKey = "da2-es2s6oj4mzhbxk5yu26ss2ruj4"; + static String API_KEY_HEADER = "x-api-key"; + + static WebClient.RequestBodySpec requestBodySpec; + + @BeforeAll + static void setUp() { + requestBodySpec = WebClient + .builder() + .baseUrl(apiUrl) + .defaultHeader(API_KEY_HEADER, apiKey) + .build() + .method(HttpMethod.POST) + .uri("/graphql"); } + @Test + void testGraphQuery() { + + Map requestBody = new HashMap<>(); + requestBody.put("query", "query ListEvents {\n" + + " listEvents {\n" + + " items {\n" + + " id\n" + + " name\n" + + " where\n" + + " when\n" + + " description\n" + + " }\n" + + " }\n" + + "}"); + requestBody.put("variables", ""); + requestBody.put("operationName", "ListEvents"); + + WebClient.ResponseSpec response = requestBodySpec + .body(BodyInserters.fromValue(requestBody)) + .accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML) + .acceptCharset(StandardCharsets.UTF_8) + .retrieve(); + + String bodyString = response.bodyToMono(String.class).block(); + + assertTrue(bodyString != null && bodyString.contains("My First Event")); + } + + @Test + void testGraphAdd() { + + String queryString = "mutation add {\n" + + " createEvent(\n" + + " name:\"My added GraphQL event\"\n" + + " where:\"Day 2\"\n" + + " when:\"Saturday night\"\n" + + " description:\"Studying GraphQL\"\n" + + " ){\n" + + " id\n" + + " name\n" + + " where\n" + + " when\n" + + " description\n" + + " }\n" + + "}"; + + + Map requestBody = new HashMap<>(); + requestBody.put("query", queryString); + requestBody.put("variables", ""); + requestBody.put("operationName", "add"); + + WebClient.ResponseSpec response = requestBodySpec + .body(BodyInserters.fromValue(requestBody)) + .accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML) + .acceptCharset(StandardCharsets.UTF_8) + .retrieve(); + + String bodyString = response.bodyToMono(String.class).block(); + assertTrue(bodyString != null && bodyString.contains("Day 2")); + } } From 9a1e98598f8c8015dff5dc2edc86446d28f606b6 Mon Sep 17 00:00:00 2001 From: Kyle Doyle Date: Fri, 17 Apr 2020 19:56:42 -0400 Subject: [PATCH 3/8] Bael-3893 AWS AppSync with Spring Boot --- .../awsappsync/AwsAppSyncApplicationTests.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java index 15bcc6e9c9..005d533cbf 100644 --- a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java +++ b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java @@ -35,7 +35,7 @@ class AwsAppSyncApplicationTests { } @Test - void testGraphQuery() { + void givenGraphQuery_whenListEvents_thenReturnAllEvents() { Map requestBody = new HashMap<>(); requestBody.put("query", "query ListEvents {\n" + @@ -60,11 +60,14 @@ class AwsAppSyncApplicationTests { String bodyString = response.bodyToMono(String.class).block(); - assertTrue(bodyString != null && bodyString.contains("My First Event")); + assertNotNull(bodyString); + assertTrue(bodyString.contains("My First Event")); + assertTrue(bodyString.contains("where")); + assertTrue(bodyString.contains("when")); } @Test - void testGraphAdd() { + void givenGraphAdd_whenMutation_thenReturnIdNameDesc() { String queryString = "mutation add {\n" + " createEvent(\n" + @@ -75,8 +78,6 @@ class AwsAppSyncApplicationTests { " ){\n" + " id\n" + " name\n" + - " where\n" + - " when\n" + " description\n" + " }\n" + "}"; @@ -94,6 +95,10 @@ class AwsAppSyncApplicationTests { .retrieve(); String bodyString = response.bodyToMono(String.class).block(); - assertTrue(bodyString != null && bodyString.contains("Day 2")); + + assertNotNull(bodyString); + assertTrue(bodyString.contains("My added GraphQL event")); + assertFalse(bodyString.contains("where")); + assertFalse(bodyString.contains("when")); } } From 3746a5328554b56ff614d5abf328f104e4b6c727 Mon Sep 17 00:00:00 2001 From: Kyle Doyle Date: Fri, 17 Apr 2020 20:16:59 -0400 Subject: [PATCH 4/8] Bael 3893 - Added to modules --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 71e5d21b02..22d73f3a9e 100644 --- a/pom.xml +++ b/pom.xml @@ -1015,6 +1015,7 @@ asm atomix aws + aws-app-sync aws-lambda axon azure From 8b6c667ce058c09870c0784627fdf831a2dfe912 Mon Sep 17 00:00:00 2001 From: Kyle Doyle Date: Wed, 22 Apr 2020 21:10:52 -0400 Subject: [PATCH 5/8] Bael-3893 AWS AppSync with Spring Boot --- aws-app-sync/pom.xml | 6 -- .../awsappsync/AppSyncClientHelper.java | 32 ++++++++++ .../AwsAppSyncApplicationTests.java | 63 ++----------------- 3 files changed, 38 insertions(+), 63 deletions(-) create mode 100644 aws-app-sync/src/main/java/com/baeldung/awsappsync/AppSyncClientHelper.java diff --git a/aws-app-sync/pom.xml b/aws-app-sync/pom.xml index d30cfc96a4..ef2085ff35 100644 --- a/aws-app-sync/pom.xml +++ b/aws-app-sync/pom.xml @@ -22,12 +22,6 @@ - - com.amazonaws - aws-java-sdk-appsync - 1.11.762 - - org.springframework.boot spring-boot-starter-web diff --git a/aws-app-sync/src/main/java/com/baeldung/awsappsync/AppSyncClientHelper.java b/aws-app-sync/src/main/java/com/baeldung/awsappsync/AppSyncClientHelper.java new file mode 100644 index 0000000000..fcbc0aa275 --- /dev/null +++ b/aws-app-sync/src/main/java/com/baeldung/awsappsync/AppSyncClientHelper.java @@ -0,0 +1,32 @@ +package com.baeldung.awsappsync; + +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.WebClient; + +import java.nio.charset.StandardCharsets; +import java.util.Map; + +public class AppSyncClientHelper { + + static String apiUrl = "https://m4i3b6icrrb7livfbypfspiifi.appsync-api.us-east-2.amazonaws.com"; + static String apiKey = "da2-es2s6oj4mzhbxk5yu26ss2ruj4"; + static String API_KEY_HEADER = "x-api-key"; + + public static WebClient.ResponseSpec getResponseBodySpec(Map requestBody) { + return WebClient + .builder() + .baseUrl(apiUrl) + .defaultHeader(API_KEY_HEADER, apiKey) + .defaultHeader("Content-Type", "application/json") + .build() + .method(HttpMethod.POST) + .uri("/graphql") + .body(BodyInserters.fromValue(requestBody)) + .accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML) + .acceptCharset(StandardCharsets.UTF_8) + .retrieve(); + } + +} diff --git a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java index 005d533cbf..cd14bcd5b2 100644 --- a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java +++ b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java @@ -1,14 +1,9 @@ package com.baeldung.awsappsync; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.client.WebClient; -import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; @@ -17,48 +12,16 @@ import static org.junit.jupiter.api.Assertions.*; @SpringBootTest class AwsAppSyncApplicationTests { - static String apiUrl = "https://m4i3b6icrrb7livfbypfspiifi.appsync-api.us-east-2.amazonaws.com"; - static String apiKey = "da2-es2s6oj4mzhbxk5yu26ss2ruj4"; - static String API_KEY_HEADER = "x-api-key"; - - static WebClient.RequestBodySpec requestBodySpec; - - @BeforeAll - static void setUp() { - requestBodySpec = WebClient - .builder() - .baseUrl(apiUrl) - .defaultHeader(API_KEY_HEADER, apiKey) - .build() - .method(HttpMethod.POST) - .uri("/graphql"); - } - @Test void givenGraphQuery_whenListEvents_thenReturnAllEvents() { Map requestBody = new HashMap<>(); - requestBody.put("query", "query ListEvents {\n" + - " listEvents {\n" + - " items {\n" + - " id\n" + - " name\n" + - " where\n" + - " when\n" + - " description\n" + - " }\n" + - " }\n" + - "}"); + requestBody.put("query", "query ListEvents { listEvents { items { id name where when description } } }"); requestBody.put("variables", ""); requestBody.put("operationName", "ListEvents"); - WebClient.ResponseSpec response = requestBodySpec - .body(BodyInserters.fromValue(requestBody)) - .accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML) - .acceptCharset(StandardCharsets.UTF_8) - .retrieve(); - - String bodyString = response.bodyToMono(String.class).block(); + String bodyString = AppSyncClientHelper.getResponseBodySpec(requestBody) + .bodyToMono(String.class).block(); assertNotNull(bodyString); assertTrue(bodyString.contains("My First Event")); @@ -69,18 +32,8 @@ class AwsAppSyncApplicationTests { @Test void givenGraphAdd_whenMutation_thenReturnIdNameDesc() { - String queryString = "mutation add {\n" + - " createEvent(\n" + - " name:\"My added GraphQL event\"\n" + - " where:\"Day 2\"\n" + - " when:\"Saturday night\"\n" + - " description:\"Studying GraphQL\"\n" + - " ){\n" + - " id\n" + - " name\n" + - " description\n" + - " }\n" + - "}"; + String queryString = "mutation add { createEvent( name:\"My added GraphQL event\" where:\"Day 2\"" + + " when:\"Saturday night\" description:\"Studying GraphQL\" ){ id name description } }"; Map requestBody = new HashMap<>(); @@ -88,11 +41,7 @@ class AwsAppSyncApplicationTests { requestBody.put("variables", ""); requestBody.put("operationName", "add"); - WebClient.ResponseSpec response = requestBodySpec - .body(BodyInserters.fromValue(requestBody)) - .accept(MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML) - .acceptCharset(StandardCharsets.UTF_8) - .retrieve(); + WebClient.ResponseSpec response = AppSyncClientHelper.getResponseBodySpec(requestBody); String bodyString = response.bodyToMono(String.class).block(); From c10208b4d926ad4ee6795082cecba8c3228415bc Mon Sep 17 00:00:00 2001 From: Kyle Doyle Date: Fri, 1 May 2020 19:48:38 -0400 Subject: [PATCH 6/8] Bael 3893 - Code review updates --- .../awsappsync/AppSyncClientHelper.java | 2 +- .../awsappsync/AwsAppSyncApplication.java | 6 +- .../AwsAppSyncApplicationTests.java | 77 ++++++++++++------- pom.xml | 2 +- 4 files changed, 53 insertions(+), 34 deletions(-) diff --git a/aws-app-sync/src/main/java/com/baeldung/awsappsync/AppSyncClientHelper.java b/aws-app-sync/src/main/java/com/baeldung/awsappsync/AppSyncClientHelper.java index fcbc0aa275..b310e60748 100644 --- a/aws-app-sync/src/main/java/com/baeldung/awsappsync/AppSyncClientHelper.java +++ b/aws-app-sync/src/main/java/com/baeldung/awsappsync/AppSyncClientHelper.java @@ -11,7 +11,7 @@ import java.util.Map; public class AppSyncClientHelper { static String apiUrl = "https://m4i3b6icrrb7livfbypfspiifi.appsync-api.us-east-2.amazonaws.com"; - static String apiKey = "da2-es2s6oj4mzhbxk5yu26ss2ruj4"; + static String apiKey = "da2-bm4rpatkkrc5jfyhvvq7itjeke"; static String API_KEY_HEADER = "x-api-key"; public static WebClient.ResponseSpec getResponseBodySpec(Map requestBody) { diff --git a/aws-app-sync/src/main/java/com/baeldung/awsappsync/AwsAppSyncApplication.java b/aws-app-sync/src/main/java/com/baeldung/awsappsync/AwsAppSyncApplication.java index ae012c91a5..19fffd2994 100644 --- a/aws-app-sync/src/main/java/com/baeldung/awsappsync/AwsAppSyncApplication.java +++ b/aws-app-sync/src/main/java/com/baeldung/awsappsync/AwsAppSyncApplication.java @@ -6,8 +6,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class AwsAppSyncApplication { - public static void main(String[] args) { - SpringApplication.run(AwsAppSyncApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(AwsAppSyncApplication.class, args); + } } diff --git a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java index cd14bcd5b2..6e94651789 100644 --- a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java +++ b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java @@ -12,42 +12,61 @@ import static org.junit.jupiter.api.Assertions.*; @SpringBootTest class AwsAppSyncApplicationTests { - @Test - void givenGraphQuery_whenListEvents_thenReturnAllEvents() { + @Test + void givenGraphQuery_whenListEvents_thenReturnAllEvents() { - Map requestBody = new HashMap<>(); - requestBody.put("query", "query ListEvents { listEvents { items { id name where when description } } }"); - requestBody.put("variables", ""); - requestBody.put("operationName", "ListEvents"); + Map requestBody = new HashMap<>(); + requestBody.put("query", "query ListEvents {" + + " listEvents {" + + " items {" + + " id" + + " name" + + " where" + + " when" + + " description" + + " }" + + " }" + + "}"); + requestBody.put("variables", ""); + requestBody.put("operationName", "ListEvents"); - String bodyString = AppSyncClientHelper.getResponseBodySpec(requestBody) - .bodyToMono(String.class).block(); + String bodyString = AppSyncClientHelper.getResponseBodySpec(requestBody) + .bodyToMono(String.class).block(); - assertNotNull(bodyString); - assertTrue(bodyString.contains("My First Event")); - assertTrue(bodyString.contains("where")); - assertTrue(bodyString.contains("when")); - } + assertNotNull(bodyString); + assertTrue(bodyString.contains("My First Event")); + assertTrue(bodyString.contains("where")); + assertTrue(bodyString.contains("when")); + } - @Test - void givenGraphAdd_whenMutation_thenReturnIdNameDesc() { + @Test + void givenGraphAdd_whenMutation_thenReturnIdNameDesc() { - String queryString = "mutation add { createEvent( name:\"My added GraphQL event\" where:\"Day 2\"" + - " when:\"Saturday night\" description:\"Studying GraphQL\" ){ id name description } }"; + String queryString = "mutation add {" + + " createEvent(" + + " name:\"My added GraphQL event\"" + + " where:\"Day 2\"" + + " when:\"Saturday night\"" + + " description:\"Studying GraphQL\"" + + " ){" + + " id" + + " name" + + " description" + + " }" + + "}"; + Map requestBody = new HashMap<>(); + requestBody.put("query", queryString); + requestBody.put("variables", ""); + requestBody.put("operationName", "add"); - Map requestBody = new HashMap<>(); - requestBody.put("query", queryString); - requestBody.put("variables", ""); - requestBody.put("operationName", "add"); + WebClient.ResponseSpec response = AppSyncClientHelper.getResponseBodySpec(requestBody); - WebClient.ResponseSpec response = AppSyncClientHelper.getResponseBodySpec(requestBody); + String bodyString = response.bodyToMono(String.class).block(); - String bodyString = response.bodyToMono(String.class).block(); - - assertNotNull(bodyString); - assertTrue(bodyString.contains("My added GraphQL event")); - assertFalse(bodyString.contains("where")); - assertFalse(bodyString.contains("when")); - } + assertNotNull(bodyString); + assertTrue(bodyString.contains("My added GraphQL event")); + assertFalse(bodyString.contains("where")); + assertFalse(bodyString.contains("when")); + } } diff --git a/pom.xml b/pom.xml index 22d73f3a9e..8f2cc8e902 100644 --- a/pom.xml +++ b/pom.xml @@ -1015,7 +1015,7 @@ asm atomix aws - aws-app-sync + aws-app-sync aws-lambda axon azure From f8cae12a3830b303442bcd808439a9f057027def Mon Sep 17 00:00:00 2001 From: Kyle Doyle Date: Sun, 3 May 2020 13:53:19 -0400 Subject: [PATCH 7/8] Bael-3893 - Updated indents with 4 spaces --- aws-app-sync/pom.xml | 90 ++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/aws-app-sync/pom.xml b/aws-app-sync/pom.xml index ef2085ff35..1f915978ab 100644 --- a/aws-app-sync/pom.xml +++ b/aws-app-sync/pom.xml @@ -1,56 +1,56 @@ - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.2.6.RELEASE - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.2.6.RELEASE + + - com.baeldung - aws-app-sync - 0.0.1-SNAPSHOT - aws-app-sync + com.baeldung + aws-app-sync + 0.0.1-SNAPSHOT + aws-app-sync - Spring Boot using AWS App Sync + Spring Boot using AWS App Sync - - 1.8 - + + 1.8 + - + - - org.springframework.boot - spring-boot-starter-web - + + org.springframework.boot + spring-boot-starter-web + - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - org.springframework.boot - spring-boot-starter-webflux - - + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.springframework.boot + spring-boot-starter-webflux + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + From 9194d94eeb45c347a4a559de40509fdd147c931b Mon Sep 17 00:00:00 2001 From: Kyle Doyle Date: Mon, 11 May 2020 08:28:13 -0400 Subject: [PATCH 8/8] Bael-3893 - Fixed string concatenation operator --- .../AwsAppSyncApplicationTests.java | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java index 6e94651789..22d99959b3 100644 --- a/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java +++ b/aws-app-sync/src/test/java/com/baeldung/awsappsync/AwsAppSyncApplicationTests.java @@ -16,17 +16,17 @@ class AwsAppSyncApplicationTests { void givenGraphQuery_whenListEvents_thenReturnAllEvents() { Map requestBody = new HashMap<>(); - requestBody.put("query", "query ListEvents {" + - " listEvents {" + - " items {" + - " id" + - " name" + - " where" + - " when" + - " description" + - " }" + - " }" + - "}"); + requestBody.put("query", "query ListEvents {" + + " listEvents {" + + " items {" + + " id" + + " name" + + " where" + + " when" + + " description" + + " }" + + " }" + + "}"); requestBody.put("variables", ""); requestBody.put("operationName", "ListEvents"); @@ -42,18 +42,18 @@ class AwsAppSyncApplicationTests { @Test void givenGraphAdd_whenMutation_thenReturnIdNameDesc() { - String queryString = "mutation add {" + - " createEvent(" + - " name:\"My added GraphQL event\"" + - " where:\"Day 2\"" + - " when:\"Saturday night\"" + - " description:\"Studying GraphQL\"" + - " ){" + - " id" + - " name" + - " description" + - " }" + - "}"; + String queryString = "mutation add {" + + " createEvent(" + + " name:\"My added GraphQL event\"" + + " where:\"Day 2\"" + + " when:\"Saturday night\"" + + " description:\"Studying GraphQL\"" + + " ){" + + " id" + + " name" + + " description" + + " }" + + "}"; Map requestBody = new HashMap<>(); requestBody.put("query", queryString);