2
2
3
3
import com .example .demo .gql .FileUploadInput ;
4
4
import com .netflix .graphql .dgs .DgsQueryExecutor ;
5
+ import com .netflix .graphql .dgs .test .EnableDgsTest ;
6
+ import org .intellij .lang .annotations .Language ;
5
7
import org .junit .jupiter .api .Disabled ;
6
8
import org .junit .jupiter .api .Test ;
7
9
import org .springframework .beans .factory .annotation .Autowired ;
14
16
import static org .assertj .core .api .Assertions .assertThat ;
15
17
16
18
@ SpringBootTest ()
19
+ @ EnableDgsTest
17
20
class DemoApplicationTests {
18
21
19
22
@ Autowired
20
23
DgsQueryExecutor dgsQueryExecutor ;
21
24
22
25
@ Test
23
26
public void testUpload () {
24
- var query = "mutation upload($file:Upload!){ upload(file:$file) }" ;
27
+ @ Language ( "GraphQL" ) var query = "mutation upload($file:Upload!){ upload(file:$file) }" ;
25
28
var result = dgsQueryExecutor .executeAndExtractJsonPathAsObject (
26
29
query ,
27
30
"data.upload" ,
@@ -34,7 +37,7 @@ public void testUpload() {
34
37
35
38
@ Test
36
39
public void testUploadWithDesc () {
37
- var query = "mutation uploadWithDesc($desc:String, $file:Upload!){ uploadWithDesc(desc:$desc, file:$file) }" ;
40
+ @ Language ( "GraphQL" ) var query = "mutation uploadWithDesc($desc:String, $file:Upload!){ uploadWithDesc(desc:$desc, file:$file) }" ;
38
41
var result = dgsQueryExecutor .executeAndExtractJsonPathAsObject (
39
42
query ,
40
43
"data.uploadWithDesc" ,
@@ -48,7 +51,7 @@ public void testUploadWithDesc() {
48
51
49
52
@ Test
50
53
public void testUploads () {
51
- var query = "mutation uploads($files:[Upload!]!){ uploads(files:$files) }" ;
54
+ @ Language ( "GraphQL" ) var query = "mutation uploads($files:[Upload!]!){ uploads(files:$files) }" ;
52
55
var result = dgsQueryExecutor .executeAndExtractJsonPathAsObject (
53
56
query ,
54
57
"data.uploads" ,
@@ -67,7 +70,7 @@ public void testUploads() {
67
70
@ Test
68
71
@ Disabled ("this dose not work" )
69
72
public void testFileUpload () {
70
- var query = "mutation fileUpload($file:FileUploadInput!){ fileUpload(file:$file) }" ;
73
+ @ Language ( "GraphQL" ) var query = "mutation fileUpload($file:FileUploadInput!){ fileUpload(file:$file) }" ;
71
74
var result = dgsQueryExecutor .executeAndExtractJsonPathAsObject (
72
75
query ,
73
76
"data.fileUpload" ,
@@ -86,8 +89,9 @@ public void testFileUpload() {
86
89
@ Test
87
90
@ Disabled ("this dose not work" )
88
91
public void testFileUploads () {
89
- var query = "mutation fileUploads($files:[FileUploadInput!]!){ fileUploads(files:$files)}" ;
92
+ @ Language ( "GraphQL" ) var query = "mutation fileUploads($files:[FileUploadInput!]!){ fileUploads(files:$files)}" ;
90
93
var result = dgsQueryExecutor .executeAndExtractJsonPathAsObject (
94
+
91
95
query ,
92
96
"data.fileUploads" ,
93
97
Map .of ("files" ,
0 commit comments