File tree 19 files changed +141
-29
lines changed
graphql-jpa-query-boot-starter
main/java/com/introproventures/graphql/jpa/query/boot/autoconfigure
test/java/com/introproventures/graphql/jpa/query
graphql-jpa-query-dependencies
java/com/introproventures/graphql/jpa/query/web
test/java/com/introproventures/graphql/jpa/query/web
19 files changed +141
-29
lines changed Original file line number Diff line number Diff line change 1
1
# Eclipse
2
- # .classpath
3
2
.project /
4
3
.settings /
5
4
build /
@@ -21,13 +20,4 @@ target/
21
20
# Eclipse
22
21
.project
23
22
.springBeans
24
-
25
-
26
-
27
- graphql-jpa-query-schema /\. classpath
28
-
29
- graphql-jpa-query-annotations /\. classpath
30
-
31
- graphql-jpa-query-example /\. classpath
32
-
33
- graphql-jpa-query-boot-starter /\. classpath
23
+ .classpath
Original file line number Diff line number Diff line change 23
23
<artifactId >graphql-jpa-query-autoconfigure</artifactId >
24
24
</dependency >
25
25
26
+ <dependency >
27
+ <groupId >com.introproventures</groupId >
28
+ <artifactId >graphql-jpa-query-web</artifactId >
29
+ </dependency >
30
+
26
31
<dependency >
27
32
<groupId >org.springframework.boot</groupId >
28
33
<artifactId >spring-boot-starter</artifactId >
Original file line number Diff line number Diff line change 22
22
import java .lang .annotation .Retention ;
23
23
import java .lang .annotation .Target ;
24
24
25
+ import com .introproventures .graphql .jpa .query .boot .autoconfigure .GraphQLJpaQueryAutoConfiguration .DefaultGraphQLJpaQueryConfiguration ;
26
+ import com .introproventures .graphql .jpa .query .boot .autoconfigure .GraphQLJpaQueryAutoConfiguration .GraphQLJpaQuerySchemaConfigurer ;
25
27
import org .springframework .context .annotation .Import ;
26
28
import org .springframework .context .annotation .PropertySource ;
27
29
28
- import com .introproventures .graphql .jpa .query .boot .autoconfigure .GraphQLJpaQueryAutoConfiguration .DefaultActivitiGraphQLJpaConfiguration ;
29
-
30
30
@ Documented
31
31
@ Retention ( RUNTIME )
32
32
@ Target ( TYPE )
33
- @ Import (DefaultActivitiGraphQLJpaConfiguration .class )
33
+ @ Import ({ DefaultGraphQLJpaQueryConfiguration .class , GraphQLJpaQuerySchemaConfigurer . class } )
34
34
@ PropertySource ("classpath:/com/introproventures/graphql/jpa/query/boot/autoconfigure/default.properties" )
35
35
public @interface EnableGraphQLJpaQuery {
36
36
Original file line number Diff line number Diff line change 23
23
import com .introproventures .graphql .jpa .query .schema .GraphQLSchemaBuilder ;
24
24
import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaExecutor ;
25
25
import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaSchemaBuilder ;
26
- import com .introproventures .graphql .jpa .query .web .GraphQLController ;
27
26
import graphql .GraphQL ;
28
27
import graphql .schema .GraphQLSchema ;
29
28
import org .springframework .beans .factory .annotation .Autowired ;
33
32
import org .springframework .boot .context .properties .EnableConfigurationProperties ;
34
33
import org .springframework .context .annotation .Bean ;
35
34
import org .springframework .context .annotation .Configuration ;
36
- import org .springframework .context .annotation .Import ;
37
35
import org .springframework .context .annotation .ImportAware ;
38
36
import org .springframework .context .annotation .PropertySource ;
39
37
import org .springframework .core .type .AnnotationMetadata ;
@@ -62,9 +60,8 @@ public void configure(GraphQLShemaRegistration registry) {
62
60
}
63
61
64
62
@ Configuration
65
- @ Import (GraphQLController .class )
66
63
@ EnableConfigurationProperties (GraphQLJpaQueryProperties .class )
67
- public static class DefaultActivitiGraphQLJpaConfiguration implements ImportAware {
64
+ public static class DefaultGraphQLJpaQueryConfiguration implements ImportAware {
68
65
69
66
@ Autowired
70
67
GraphQLJpaQueryProperties properties ;
Original file line number Diff line number Diff line change 30
30
import com .introproventures .graphql .jpa .query .schema .GraphQLSchemaBuilder ;
31
31
import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaExecutor ;
32
32
import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaSchemaBuilder ;
33
- import com .introproventures .graphql .jpa .query .web .model .Author ;
33
+ import com .introproventures .graphql .jpa .query .starter .model .Author ;
34
34
35
35
@ RunWith (SpringRunner .class )
36
36
@ SpringBootTest (
Original file line number Diff line number Diff line change 30
30
import com .introproventures .graphql .jpa .query .schema .GraphQLSchemaBuilder ;
31
31
import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaExecutor ;
32
32
import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaSchemaBuilder ;
33
- import com .introproventures .graphql .jpa .query .web .model .Author ;
33
+ import com .introproventures .graphql .jpa .query .starter .model .Author ;
34
34
35
35
@ RunWith (SpringRunner .class )
36
36
@ SpringBootTest (webEnvironment = WebEnvironment .RANDOM_PORT )
Original file line number Diff line number Diff line change 13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- package com .introproventures .graphql .jpa .query .web ;
16
+ package com .introproventures .graphql .jpa .query .starter ;
17
17
18
18
import java .io .IOException ;
19
19
import java .util .HashMap ;
41
41
42
42
@ RunWith (SpringRunner .class )
43
43
@ SpringBootTest (webEnvironment = WebEnvironment .RANDOM_PORT )
44
- public class GraphQLControllerIT {
44
+ public class GraphQLJpaQueryStarterIT {
45
45
private static final String WAR_AND_PEACE = "War and Peace" ;
46
46
47
47
@ SpringBootApplication
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- package com .introproventures .graphql .jpa .query .web .model ;
17
+ package com .introproventures .graphql .jpa .query .starter .model ;
18
18
19
19
import java .util .Collection ;
20
20
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- package com .introproventures .graphql .jpa .query .web .model ;
17
+ package com .introproventures .graphql .jpa .query .starter .model ;
18
18
19
19
import javax .persistence .Entity ;
20
20
import javax .persistence .EnumType ;
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- package com .introproventures .graphql .jpa .query .web .model ;
17
+ package com .introproventures .graphql .jpa .query .starter .model ;
18
18
19
19
public enum Genre {
20
20
NOVEL , PLAY
Original file line number Diff line number Diff line change 59
59
<artifactId >graphql-jpa-query-autoconfigure</artifactId >
60
60
<version >${project.version} </version >
61
61
</dependency >
62
+ <dependency >
63
+ <groupId >com.introproventures</groupId >
64
+ <artifactId >graphql-jpa-query-web</artifactId >
65
+ <version >${project.version} </version >
66
+ </dependency >
62
67
</dependencies >
63
68
</dependencyManagement >
64
69
Original file line number Diff line number Diff line change
1
+ <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" >
2
+ <modelVersion >4.0.0</modelVersion >
3
+ <parent >
4
+ <groupId >com.introproventures</groupId >
5
+ <artifactId >graphql-jpa-query-build</artifactId >
6
+ <version >0.3.13-SNAPSHOT</version >
7
+ <relativePath >../graphql-jpa-query-build</relativePath >
8
+ </parent >
9
+ <artifactId >graphql-jpa-query-web</artifactId >
10
+
11
+ <dependencies >
12
+ <dependency >
13
+ <groupId >com.introproventures</groupId >
14
+ <artifactId >graphql-jpa-query-schema</artifactId >
15
+ <optional >true</optional >
16
+ </dependency >
17
+ <dependency >
18
+ <groupId >org.springframework.boot</groupId >
19
+ <artifactId >spring-boot-starter-web</artifactId >
20
+ <optional >true</optional >
21
+ </dependency >
22
+ </dependencies >
23
+
24
+ </project >
Original file line number Diff line number Diff line change 26
26
import com .introproventures .graphql .jpa .query .schema .GraphQLExecutor ;
27
27
import com .introproventures .graphql .jpa .query .schema .impl .GraphQLJpaExecutor ;
28
28
import graphql .ExecutionResult ;
29
- import org .springframework .boot .autoconfigure .condition .ConditionalOnClass ;
30
- import org .springframework .boot .autoconfigure .condition .ConditionalOnWebApplication ;
31
29
import org .springframework .http .MediaType ;
32
30
import org .springframework .validation .annotation .Validated ;
33
31
import org .springframework .web .bind .annotation .GetMapping ;
43
41
*
44
42
*/
45
43
@ RestController
46
- @ ConditionalOnWebApplication
47
- @ ConditionalOnClass (GraphQLExecutor .class )
48
44
public class GraphQLController {
49
45
50
46
private static final String PATH = "${spring.graphql.jpa.query.path:/graphql}" ;
Original file line number Diff line number Diff line change
1
+ package com .introproventures .graphql .jpa .query .web .autoconfigure ;
2
+
3
+ import com .introproventures .graphql .jpa .query .schema .GraphQLExecutor ;
4
+ import com .introproventures .graphql .jpa .query .web .GraphQLController ;
5
+ import org .springframework .boot .autoconfigure .condition .ConditionalOnClass ;
6
+ import org .springframework .boot .autoconfigure .condition .ConditionalOnWebApplication ;
7
+ import org .springframework .context .annotation .Configuration ;
8
+ import org .springframework .context .annotation .Import ;
9
+
10
+ @ Configuration
11
+ @ ConditionalOnWebApplication
12
+ @ ConditionalOnClass (GraphQLExecutor .class )
13
+ public class GraphQLControllerAutoConfiguration {
14
+
15
+ @ Import (GraphQLController .class )
16
+ public static class DefaultGraphQLControllerConfiguration {
17
+
18
+ }
19
+
20
+ }
Original file line number Diff line number Diff line change
1
+ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2
+ com.introproventures.graphql.jpa.query.web.autoconfigure.GraphQLControllerAutoConfiguration
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ package com .introproventures .graphql .jpa .query .web .autoconfigure ;
2
+
3
+ import static org .assertj .core .api .Assertions .assertThat ;
4
+
5
+ import com .introproventures .graphql .jpa .query .schema .GraphQLExecutor ;
6
+ import com .introproventures .graphql .jpa .query .web .GraphQLController ;
7
+ import org .junit .Test ;
8
+ import org .junit .runner .RunWith ;
9
+ import org .springframework .beans .factory .annotation .Autowired ;
10
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
11
+ import org .springframework .boot .test .context .SpringBootTest ;
12
+ import org .springframework .boot .test .context .SpringBootTest .WebEnvironment ;
13
+ import org .springframework .boot .test .mock .mockito .MockBean ;
14
+ import org .springframework .test .context .junit4 .SpringRunner ;
15
+
16
+ @ RunWith (SpringRunner .class )
17
+ @ SpringBootTest (webEnvironment =WebEnvironment .RANDOM_PORT )
18
+ public class GraphQLControllerAutoConfigurationTest {
19
+
20
+ @ MockBean
21
+ private GraphQLExecutor graphQLExecutor ;
22
+
23
+ @ Autowired
24
+ private GraphQLController graphQLController ;
25
+
26
+ @ SpringBootApplication
27
+ static class Application {
28
+
29
+ }
30
+
31
+ @ Test
32
+ public void contextLoads () {
33
+ assertThat (graphQLController ).isNotNull ();
34
+ }
35
+
36
+ }
Original file line number Diff line number Diff line change
1
+ package com .introproventures .graphql .jpa .query .web .autoconfigure ;
2
+
3
+ import static org .assertj .core .api .Assertions .assertThat ;
4
+
5
+ import com .introproventures .graphql .jpa .query .schema .GraphQLExecutor ;
6
+ import com .introproventures .graphql .jpa .query .web .GraphQLController ;
7
+ import org .junit .Test ;
8
+ import org .junit .runner .RunWith ;
9
+ import org .springframework .beans .factory .annotation .Autowired ;
10
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
11
+ import org .springframework .boot .test .context .SpringBootTest ;
12
+ import org .springframework .boot .test .context .SpringBootTest .WebEnvironment ;
13
+ import org .springframework .boot .test .mock .mockito .MockBean ;
14
+ import org .springframework .test .context .junit4 .SpringRunner ;
15
+
16
+ @ RunWith (SpringRunner .class )
17
+ @ SpringBootTest (webEnvironment =WebEnvironment .NONE )
18
+ public class GraphQLControllerAutoConfigurationWebNoneTest {
19
+
20
+ @ MockBean
21
+ private GraphQLExecutor graphQLExecutor ;
22
+
23
+ @ Autowired (required =false )
24
+ private GraphQLController graphQLController ;
25
+
26
+ @ SpringBootApplication
27
+ static class Application {
28
+
29
+ }
30
+
31
+ @ Test
32
+ public void contextLoads () {
33
+ assertThat (graphQLController ).isNull ();
34
+ }
35
+
36
+ }
Original file line number Diff line number Diff line change 38
38
<module >graphql-jpa-query-dependencies</module >
39
39
<module >graphql-jpa-query-build</module >
40
40
<module >graphql-jpa-query-autoconfigure</module >
41
+ <module >graphql-jpa-query-web</module >
41
42
</modules >
42
43
43
44
<distributionManagement >
You can’t perform that action at this time.
0 commit comments