@@ -43,61 +43,33 @@ public void exampleGet() {
43
43
when (exampleService .processExample (any ())).thenReturn (new ExampleResult ("BYE" ));
44
44
45
45
given ().contentType (ContentType .JSON )
46
- .queryParam ("exampleParam" , "HELLO_PARAM" )
47
- .get ("/get/{exampleValue}" , "HELLO_PATH" )
48
- .then ()
49
- .status (HttpStatus .OK )
50
- .apply (
51
- document (
52
- "exampleGet" ,
53
- requestPreprocessor (),
54
- responsePreprocessor (),
55
- pathParameters (
56
- parameterWithName ("exampleValue" )
57
- .description ("ExampleValue" )),
58
- queryParameters (
59
- parameterWithName ("exampleParam" )
60
- .description ("ExampleParam" )),
61
- responseFields (
62
- fieldWithPath ("result" )
63
- .type (JsonFieldType .STRING )
64
- .description ("ResultType" ),
65
- fieldWithPath ("data.result" )
66
- .type (JsonFieldType .STRING )
67
- .description ("Result Date" ),
68
- fieldWithPath ("error" )
69
- .type (JsonFieldType .NULL )
70
- .ignored ())));
46
+ .queryParam ("exampleParam" , "HELLO_PARAM" )
47
+ .get ("/get/{exampleValue}" , "HELLO_PATH" )
48
+ .then ()
49
+ .status (HttpStatus .OK )
50
+ .apply (document ("exampleGet" , requestPreprocessor (), responsePreprocessor (),
51
+ pathParameters (parameterWithName ("exampleValue" ).description ("ExampleValue" )),
52
+ queryParameters (parameterWithName ("exampleParam" ).description ("ExampleParam" )),
53
+ responseFields (fieldWithPath ("result" ).type (JsonFieldType .STRING ).description ("ResultType" ),
54
+ fieldWithPath ("data.result" ).type (JsonFieldType .STRING ).description ("Result Date" ),
55
+ fieldWithPath ("error" ).type (JsonFieldType .NULL ).ignored ())));
71
56
}
72
57
73
58
@ Test
74
59
public void examplePost () {
75
60
when (exampleService .processExample (any ())).thenReturn (new ExampleResult ("BYE" ));
76
61
77
62
given ().contentType (ContentType .JSON )
78
- .body (new ExampleRequestDto ("HELLO_BODY" ))
79
- .post ("/post" )
80
- .then ()
81
- .status (HttpStatus .OK )
82
- .apply (
83
- document (
84
- "examplePost" ,
85
- requestPreprocessor (),
86
- responsePreprocessor (),
87
- requestFields (
88
- fieldWithPath ("data" )
89
- .type (JsonFieldType .STRING )
90
- .description ("ExampleBody Data Field" )),
91
- responseFields (
92
- fieldWithPath ("result" )
93
- .type (JsonFieldType .STRING )
94
- .description ("ResultType" ),
95
- fieldWithPath ("data.result" )
96
- .type (JsonFieldType .STRING )
97
- .description ("Result Date" ),
98
- fieldWithPath ("error" )
99
- .type (JsonFieldType .STRING )
100
- .ignored ())));
63
+ .body (new ExampleRequestDto ("HELLO_BODY" ))
64
+ .post ("/post" )
65
+ .then ()
66
+ .status (HttpStatus .OK )
67
+ .apply (document ("examplePost" , requestPreprocessor (), responsePreprocessor (),
68
+ requestFields (
69
+ fieldWithPath ("data" ).type (JsonFieldType .STRING ).description ("ExampleBody Data Field" )),
70
+ responseFields (fieldWithPath ("result" ).type (JsonFieldType .STRING ).description ("ResultType" ),
71
+ fieldWithPath ("data.result" ).type (JsonFieldType .STRING ).description ("Result Date" ),
72
+ fieldWithPath ("error" ).type (JsonFieldType .STRING ).ignored ())));
101
73
}
102
74
103
75
}
0 commit comments