From 74f2f3397f7db1cf4217b31951077ef6ecc36698 Mon Sep 17 00:00:00 2001 From: Felipe Reis Date: Tue, 13 Nov 2018 08:46:18 +1100 Subject: [PATCH 1/2] Add application test to subscription example --- .../java/subscription/ApplicationTests.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 subscription-example/src/test/java/com/graphql/java/subscription/ApplicationTests.java diff --git a/subscription-example/src/test/java/com/graphql/java/subscription/ApplicationTests.java b/subscription-example/src/test/java/com/graphql/java/subscription/ApplicationTests.java new file mode 100644 index 0000000..8da3d5f --- /dev/null +++ b/subscription-example/src/test/java/com/graphql/java/subscription/ApplicationTests.java @@ -0,0 +1,16 @@ +package com.graphql.java.subscription; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ApplicationTests { + + @Test + public void contextLoads() { + } + +} From 052d70f852c1630bfa6fedc9f66de3798088293f Mon Sep 17 00:00:00 2001 From: Felipe Reis Date: Tue, 13 Nov 2018 09:17:58 +1100 Subject: [PATCH 2/2] Move common Gradle config to parent project - make sure all sub-projects have passing tests --- build.gradle | 33 ++++++++++++++++++- defer/server/build.gradle | 26 --------------- hibernate-example/build.gradle | 27 --------------- http-example/build.gradle | 26 --------------- spring-boot-integration/build.gradle | 27 +-------------- .../examples/springboot/Application.java | 2 +- .../springboot/GraphQLController.java | 2 +- .../springboot/GraphQLDataFetchers.java | 2 +- .../examples/springboot/GraphQLProvider.java | 2 +- .../examples/springboot/ApplicationTests.java | 2 +- subscription-example/build.gradle | 27 --------------- 11 files changed, 38 insertions(+), 138 deletions(-) rename spring-boot-integration/src/main/java/{graphql => com/graphql/java}/examples/springboot/Application.java (85%) rename spring-boot-integration/src/main/java/{graphql => com/graphql/java}/examples/springboot/GraphQLController.java (98%) rename spring-boot-integration/src/main/java/{graphql => com/graphql/java}/examples/springboot/GraphQLDataFetchers.java (88%) rename spring-boot-integration/src/main/java/{graphql => com/graphql/java}/examples/springboot/GraphQLProvider.java (97%) rename spring-boot-integration/src/test/java/com/{graphqljava => graphql/java}/examples/springboot/ApplicationTests.java (87%) diff --git a/build.gradle b/build.gradle index 7c7e532..0259204 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,35 @@ task myWrapper(type: Wrapper) { gradleVersion = '4.10.2' distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip" -} \ No newline at end of file +} + +buildscript { + ext { + springBootVersion = '2.0.5.RELEASE' + } + repositories { + mavenCentral() + } + dependencies { + classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") + } +} + +subprojects { + repositories { + mavenCentral() + maven { url "http://dl.bintray.com/andimarek/graphql-java" } + } + + apply plugin: 'java' + apply plugin: 'eclipse' + apply plugin: 'org.springframework.boot' + apply plugin: 'io.spring.dependency-management' + + dependencies { + compile "com.graphql-java:graphql-java:10.0" + compile 'com.google.guava:guava:26.0-jre' + testCompile('org.springframework.boot:spring-boot-starter-test') + } +} + diff --git a/defer/server/build.gradle b/defer/server/build.gradle index 5278ebf..e079a4f 100644 --- a/defer/server/build.gradle +++ b/defer/server/build.gradle @@ -1,35 +1,9 @@ -buildscript { - ext { - springBootVersion = '2.0.5.RELEASE' - } - repositories { - mavenCentral() - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } -} - -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'org.springframework.boot' -apply plugin: 'io.spring.dependency-management' - group = 'com.graphql-java' version = '0.0.1-SNAPSHOT' sourceCompatibility = 1.8 -repositories { - mavenCentral() - maven { url "http://dl.bintray.com/andimarek/graphql-java" } -} - - dependencies { compile('org.springframework.boot:spring-boot-starter-webflux') compile "com.graphql-java:graphql-java:2018-09-16T01-27-46-27a6e44" - compile 'com.google.guava:guava:26.0-jre' - testCompile('org.springframework.boot:spring-boot-starter-test') testImplementation('io.projectreactor:reactor-test') - } diff --git a/hibernate-example/build.gradle b/hibernate-example/build.gradle index 05b9909..19e60b8 100644 --- a/hibernate-example/build.gradle +++ b/hibernate-example/build.gradle @@ -1,36 +1,9 @@ -buildscript { - ext { - springBootVersion = '2.0.5.RELEASE' - } - repositories { - mavenCentral() - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } -} - -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'org.springframework.boot' -apply plugin: 'io.spring.dependency-management' - group = 'com.graphql-java' version = '0.0.1-SNAPSHOT' sourceCompatibility = 1.8 -repositories { - mavenCentral() - maven { url "http://dl.bintray.com/andimarek/graphql-java" } -} - - dependencies { compile('org.springframework.boot:spring-boot-starter-web') compile('org.springframework.boot:spring-boot-starter-data-jpa') compile("com.h2database:h2") - compile "com.graphql-java:graphql-java:10.0" - compile 'com.google.guava:guava:26.0-jre' - compile("org.springframework.boot:spring-boot-devtools") - testCompile('org.springframework.boot:spring-boot-starter-test') } diff --git a/http-example/build.gradle b/http-example/build.gradle index 87df1fe..9f45310 100644 --- a/http-example/build.gradle +++ b/http-example/build.gradle @@ -1,33 +1,7 @@ -buildscript { - ext { - springBootVersion = '2.0.5.RELEASE' - } - repositories { - mavenCentral() - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } -} - -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'org.springframework.boot' -apply plugin: 'io.spring.dependency-management' - group = 'com.graphql-java' version = '0.0.1-SNAPSHOT' sourceCompatibility = 1.8 -repositories { - mavenCentral() - maven { url "http://dl.bintray.com/andimarek/graphql-java" } -} - - dependencies { compile('org.springframework.boot:spring-boot-starter-web') - compile "com.graphql-java:graphql-java:10.0" - compile 'com.google.guava:guava:26.0-jre' - testCompile('org.springframework.boot:spring-boot-starter-test') } diff --git a/spring-boot-integration/build.gradle b/spring-boot-integration/build.gradle index d405e30..666491c 100644 --- a/spring-boot-integration/build.gradle +++ b/spring-boot-integration/build.gradle @@ -1,32 +1,7 @@ -buildscript { - ext { - springBootVersion = '2.0.5.RELEASE' - } - repositories { - mavenCentral() - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } -} - -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'org.springframework.boot' -apply plugin: 'io.spring.dependency-management' - group = 'com.graphql-java.examples' version = '0.0.1-SNAPSHOT' sourceCompatibility = 1.8 -repositories { - mavenCentral() -} - - dependencies { - implementation('org.springframework.boot:spring-boot-starter-web') - implementation('com.graphql-java:graphql-java:10.0') - implementation('com.google.guava:guava:26.0-jre') - testImplementation('org.springframework.boot:spring-boot-starter-test') + compile('org.springframework.boot:spring-boot-starter-web') } diff --git a/spring-boot-integration/src/main/java/graphql/examples/springboot/Application.java b/spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/Application.java similarity index 85% rename from spring-boot-integration/src/main/java/graphql/examples/springboot/Application.java rename to spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/Application.java index ba45440..50c7720 100644 --- a/spring-boot-integration/src/main/java/graphql/examples/springboot/Application.java +++ b/spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/Application.java @@ -1,4 +1,4 @@ -package graphql.examples.springboot; +package com.graphql.java.examples.springboot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-boot-integration/src/main/java/graphql/examples/springboot/GraphQLController.java b/spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/GraphQLController.java similarity index 98% rename from spring-boot-integration/src/main/java/graphql/examples/springboot/GraphQLController.java rename to spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/GraphQLController.java index 7c5c933..4faeead 100644 --- a/spring-boot-integration/src/main/java/graphql/examples/springboot/GraphQLController.java +++ b/spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/GraphQLController.java @@ -1,4 +1,4 @@ -package graphql.examples.springboot; +package com.graphql.java.examples.springboot; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/spring-boot-integration/src/main/java/graphql/examples/springboot/GraphQLDataFetchers.java b/spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/GraphQLDataFetchers.java similarity index 88% rename from spring-boot-integration/src/main/java/graphql/examples/springboot/GraphQLDataFetchers.java rename to spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/GraphQLDataFetchers.java index 1f0da89..900baae 100644 --- a/spring-boot-integration/src/main/java/graphql/examples/springboot/GraphQLDataFetchers.java +++ b/spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/GraphQLDataFetchers.java @@ -1,4 +1,4 @@ -package graphql.examples.springboot; +package com.graphql.java.examples.springboot; import graphql.schema.DataFetcher; import org.springframework.stereotype.Component; diff --git a/spring-boot-integration/src/main/java/graphql/examples/springboot/GraphQLProvider.java b/spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/GraphQLProvider.java similarity index 97% rename from spring-boot-integration/src/main/java/graphql/examples/springboot/GraphQLProvider.java rename to spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/GraphQLProvider.java index a4bf55f..2b01877 100644 --- a/spring-boot-integration/src/main/java/graphql/examples/springboot/GraphQLProvider.java +++ b/spring-boot-integration/src/main/java/com/graphql/java/examples/springboot/GraphQLProvider.java @@ -1,4 +1,4 @@ -package graphql.examples.springboot; +package com.graphql.java.examples.springboot; import com.google.common.base.Charsets; import com.google.common.io.Resources; diff --git a/spring-boot-integration/src/test/java/com/graphqljava/examples/springboot/ApplicationTests.java b/spring-boot-integration/src/test/java/com/graphql/java/examples/springboot/ApplicationTests.java similarity index 87% rename from spring-boot-integration/src/test/java/com/graphqljava/examples/springboot/ApplicationTests.java rename to spring-boot-integration/src/test/java/com/graphql/java/examples/springboot/ApplicationTests.java index 7785f46..6af063a 100644 --- a/spring-boot-integration/src/test/java/com/graphqljava/examples/springboot/ApplicationTests.java +++ b/spring-boot-integration/src/test/java/com/graphql/java/examples/springboot/ApplicationTests.java @@ -1,4 +1,4 @@ -package com.graphqljava.examples.springboot; +package com.graphql.java.examples.springboot; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/subscription-example/build.gradle b/subscription-example/build.gradle index c8d9ef7..e0ab7b2 100644 --- a/subscription-example/build.gradle +++ b/subscription-example/build.gradle @@ -1,37 +1,10 @@ -buildscript { - ext { - springBootVersion = '2.0.5.RELEASE' - } - repositories { - mavenCentral() - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } -} - -apply plugin: 'java' -apply plugin: 'eclipse' -apply plugin: 'org.springframework.boot' -apply plugin: 'io.spring.dependency-management' - group = 'com.graphql-java' version = '0.0.1-SNAPSHOT' sourceCompatibility = 1.8 -repositories { - mavenCentral() - maven { url "http://dl.bintray.com/andimarek/graphql-java" } -} - - dependencies { - compile('org.springframework.boot:spring-boot-starter-web') compile('org.springframework.boot:spring-boot-starter-websocket') - compile "com.graphql-java:graphql-java:10.0" compile "io.reactivex.rxjava2:rxjava:2.1.5" compile "com.google.code.gson:gson:2.8.0" - - testCompile('org.springframework.boot:spring-boot-starter-test') }