diff --git a/Dockerfile b/Dockerfile index 9538c85..2614c74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:10.9-alpine AS web-build -WORKDIR /build -ADD react-web /build +WORKDIR /home +ADD react-web /home RUN apk add yarn RUN yarn && yarn build @@ -9,13 +9,13 @@ RUN find build FROM openjdk:8u171-jdk-alpine3.8 AS java-build -WORKDIR /build -COPY --from=web-build /build/build /build/src/main/resources/public -ADD . /build +WORKDIR /home +COPY --from=web-build /home/build /home/src/main/resources/public +ADD . /home RUN ./gradlew build FROM openjdk:8u171-jre-alpine3.8 -COPY --from=java-build /build/build/libs/graphql-demo-service.jar /app/graphql-demo-service.jar +COPY --from=java-build /home/build/libs/graphql-demo-service.jar /app/graphql-demo-service.jar EXPOSE 8080 CMD java -jar /app/graphql-demo-service.jar \ No newline at end of file diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 311caeb..9578661 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -21,6 +21,7 @@ libraries.graphql = [ 'com.graphql-java:graphiql-spring-boot-starter:5.0.2', 'com.graphql-java:graphql-java-tools:5.2.3' ] + libraries.database = [ 'com.h2database:h2' ] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a95009c..0f64538 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Wed Sep 12 17:40:13 CEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip diff --git a/src/test/java/ofouro/code/graphql/demo/graphql/GraphQLConferenceTest.java b/src/test/java/ofouro/code/graphql/demo/graphql/GraphQLConferenceTest.java index e936836..f22b9b8 100644 --- a/src/test/java/ofouro/code/graphql/demo/graphql/GraphQLConferenceTest.java +++ b/src/test/java/ofouro/code/graphql/demo/graphql/GraphQLConferenceTest.java @@ -116,14 +116,18 @@ public void testConnections() throws IOException { } private GraphQLResponse findConference(InputConference filter) throws IOException { - final ObjectMapper mapper = new ObjectMapper(); + // create GraphQL Variables + final ObjectMapper mapper = new ObjectMapper(); final ObjectNode filterNode = mapper.createObjectNode(); filterNode.set("filter", mapper.convertValue(filter, JsonNode.class)); - GraphQLResponse findResponse = graphQLTestTemplate.perform("queries/find-conferences-by-filter.graphql", filterNode); - log.info(String.format("Response: %s", findResponse.getRawResponse().toString())); + // Perform GraphQL request + GraphQLResponse findResponse = graphQLTestTemplate + .perform("queries/find-conferences-by-filter.graphql", filterNode); + log.info(String.format("Response: %s", findResponse.getRawResponse())); + // Minimal assert to check the response contains no errors assertNotNull(findResponse); assertTrue(findResponse.isOk()); assertNotNull(findResponse.context().read("data.conferences"));