@@ -205,26 +205,28 @@ void replaceMethodAnnotations() throws Exception {
205
205
" }\n " +
206
206
"}" ;
207
207
208
+ @ Language ("java" )
208
209
String expected =
209
- "import org.springframework.web.bind.annotation.RequestMapping;\n " +
210
- "import org.springframework.web.bind.annotation.RequestMethod;\n " +
211
- "import org.springframework.web.bind.annotation.RestController;\n " +
212
- "import javax.ws.rs.PathParam;\n " +
213
- "import javax.ws.rs.core.MediaType;\n " +
214
- "\n " +
215
- "\n " +
216
- "@RestController\n " +
217
- "@RequestMapping(value = \" /hello\" )\n " +
218
- "class ControllerClass {\n " +
219
- " @RequestMapping(value = \" /json/{name}\" , produces = {\" image/jpeg\" , \" image/gif\" , \" image/png\" , MediaType.APPLICATION_XML}, consumes = \" application/json\" ," +
220
- " method = {RequestMethod.POST, RequestMethod.GET, RequestMethod.PUT, RequestMethod.DELETE})\n " +
221
- " public String getHelloWorldJSON(@PathParam(\" name\" ) String name) {\n " +
222
- " return \" Hello\" ;\n " +
223
- " }\n " +
224
- " public String notAnEndpoint(@PathParam(\" name\" ) String name) {\n " +
225
- " return \" Hello\" ;\n " +
226
- " }\n " +
227
- "}" ;
210
+ """
211
+ import org.springframework.web.bind.annotation.RequestMapping;
212
+ import org.springframework.web.bind.annotation.RequestMethod;
213
+ import org.springframework.web.bind.annotation.RestController;
214
+
215
+ import javax.ws.rs.PathParam;
216
+ import javax.ws.rs.core.MediaType;
217
+
218
+
219
+ @RestController
220
+ @RequestMapping(value = "/hello")
221
+ class ControllerClass {
222
+ @RequestMapping(value = "/json/{name}", produces = {"image/jpeg", "image/gif", "image/png", MediaType.APPLICATION_XML}, consumes = "application/json", method = {RequestMethod.POST, RequestMethod.GET, RequestMethod.PUT, RequestMethod.DELETE})
223
+ public String getHelloWorldJSON(@PathParam("name") String name) {
224
+ return "Hello";
225
+ }
226
+ public String notAnEndpoint(@PathParam("name") String name) {
227
+ return "Hello";
228
+ }
229
+ }""" ;
228
230
229
231
ProjectContext projectContext = TestProjectContext .buildProjectContext ()
230
232
.withJavaSources (sourceCode )
0 commit comments