-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract graphql-jpa-query-web module from starter (#74)
* fix: Extract graphql-jpa-query-web module from starter * fix: (git) add .classpath to .gitignore * fix: add GraphQLControllerAutoConfigurationTest
- Loading branch information
Showing
19 changed files
with
141 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.introproventures</groupId> | ||
<artifactId>graphql-jpa-query-build</artifactId> | ||
<version>0.3.13-SNAPSHOT</version> | ||
<relativePath>../graphql-jpa-query-build</relativePath> | ||
</parent> | ||
<artifactId>graphql-jpa-query-web</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.introproventures</groupId> | ||
<artifactId>graphql-jpa-query-schema</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...roproventures/graphql/jpa/query/web/autoconfigure/GraphQLControllerAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.introproventures.graphql.jpa.query.web.autoconfigure; | ||
|
||
import com.introproventures.graphql.jpa.query.schema.GraphQLExecutor; | ||
import com.introproventures.graphql.jpa.query.web.GraphQLController; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
|
||
@Configuration | ||
@ConditionalOnWebApplication | ||
@ConditionalOnClass(GraphQLExecutor.class) | ||
public class GraphQLControllerAutoConfiguration { | ||
|
||
@Import(GraphQLController.class) | ||
public static class DefaultGraphQLControllerConfiguration { | ||
|
||
} | ||
|
||
} |
2 changes: 2 additions & 0 deletions
2
graphql-jpa-query-web/src/main/resources/META-INF/spring.factories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ | ||
com.introproventures.graphql.jpa.query.web.autoconfigure.GraphQLControllerAutoConfiguration |
File renamed without changes.
36 changes: 36 additions & 0 deletions
36
...oventures/graphql/jpa/query/web/autoconfigure/GraphQLControllerAutoConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.introproventures.graphql.jpa.query.web.autoconfigure; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import com.introproventures.graphql.jpa.query.schema.GraphQLExecutor; | ||
import com.introproventures.graphql.jpa.query.web.GraphQLController; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; | ||
import org.springframework.boot.test.mock.mockito.MockBean; | ||
import org.springframework.test.context.junit4.SpringRunner; | ||
|
||
@RunWith(SpringRunner.class) | ||
@SpringBootTest(webEnvironment=WebEnvironment.RANDOM_PORT) | ||
public class GraphQLControllerAutoConfigurationTest { | ||
|
||
@MockBean | ||
private GraphQLExecutor graphQLExecutor; | ||
|
||
@Autowired | ||
private GraphQLController graphQLController; | ||
|
||
@SpringBootApplication | ||
static class Application { | ||
|
||
} | ||
|
||
@Test | ||
public void contextLoads() { | ||
assertThat(graphQLController).isNotNull(); | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...es/graphql/jpa/query/web/autoconfigure/GraphQLControllerAutoConfigurationWebNoneTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.introproventures.graphql.jpa.query.web.autoconfigure; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import com.introproventures.graphql.jpa.query.schema.GraphQLExecutor; | ||
import com.introproventures.graphql.jpa.query.web.GraphQLController; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; | ||
import org.springframework.boot.test.mock.mockito.MockBean; | ||
import org.springframework.test.context.junit4.SpringRunner; | ||
|
||
@RunWith(SpringRunner.class) | ||
@SpringBootTest(webEnvironment=WebEnvironment.NONE) | ||
public class GraphQLControllerAutoConfigurationWebNoneTest { | ||
|
||
@MockBean | ||
private GraphQLExecutor graphQLExecutor; | ||
|
||
@Autowired(required=false) | ||
private GraphQLController graphQLController; | ||
|
||
@SpringBootApplication | ||
static class Application { | ||
|
||
} | ||
|
||
@Test | ||
public void contextLoads() { | ||
assertThat(graphQLController).isNull(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters