Skip to content

Commit

Permalink
Clean up code (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm authored Sep 13, 2018
1 parent 6e3210c commit 71afdad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
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
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
1 change: 1 addition & 0 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit 71afdad

Please sign in to comment.