|
|
|
|
@@ -62,7 +62,7 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditorFromFileUri(docUri, LanguageId.JAVA);
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(\"/hello-world\")", "Path: [/hello-world](http://cfapps.io:1111/hello-world)\n" +
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(\"/hello-world\")", "[http://cfapps.io:1111/hello-world](http://cfapps.io:1111/hello-world)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 22022\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
@@ -94,13 +94,13 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditorFromFileUri(docUri, LanguageId.JAVA);
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(\"/hello\")", "Path: [/hello](http://cfapps.io:999/hello)\n" +
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(\"/hello\")", "[http://cfapps.io:999/hello](http://cfapps.io:999/hello)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(\"/goodbye\")", "Path: [/goodbye](http://cfapps.io:999/goodbye)\n" +
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(\"/goodbye\")", "[http://cfapps.io:999/goodbye](http://cfapps.io:999/goodbye)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
@@ -133,7 +133,7 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testDeleteMappingHoverHintMethod1() throws Exception {
|
|
|
|
|
public void testSimpleMethodHoverHintMethod1() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
@@ -171,7 +171,7 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@DeleteMapping(\"/greetings\")", "Path: [/greetings](http://cfapps.io:999/greetings)\n" +
|
|
|
|
|
editor.assertHoverContains("@DeleteMapping(\"/greetings\")", "[http://cfapps.io:999/greetings](http://cfapps.io:999/greetings)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
@@ -198,7 +198,7 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.String com.example.RestApi.deleteGreetings()\"}}")
|
|
|
|
|
"{\"{[/greetings],methods=[DELETE]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public void com.example.RestApi.deleteGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
@@ -213,7 +213,7 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@DeleteMapping(\"/greetings\")\n" +
|
|
|
|
|
"public void deleteGreetings() {\n" +
|
|
|
|
|
"public void deleteGreetings(int n) {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
@@ -223,8 +223,11 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testGetMappingHoverHintMethod1() throws Exception {
|
|
|
|
|
public void testNoHoverHintMethod() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
@@ -241,56 +244,7 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.String com.example.RestApi.greetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import java.lang.String;\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.GetMapping;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@GetMapping(\"/greetings\")\n" +
|
|
|
|
|
"public String greetings() {\n" +
|
|
|
|
|
"return \"Greetings!\";\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@GetMapping(\"/greetings\")", "Path: [/greetings](http://cfapps.io:999/greetings)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testGetMappingHoverHintMethod2() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[DELETE]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.String com.example.RestApi.greetings()\"}}")
|
|
|
|
|
"{\"{[/greetings],methods=[PUT]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.String com.example.RestApi.updateGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
@@ -300,194 +254,13 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
"\n" +
|
|
|
|
|
"import java.lang.String;\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.GetMapping;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@GetMapping(\"/greetings\")\n" +
|
|
|
|
|
"public String greetings() {\n" +
|
|
|
|
|
"return \"Greetings!\";\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertNoHover("@GetMapping(\"/greetings\")");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testPostMappingHoverHintMethod1() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[POST]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public void com.example.RestApi.createGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.PostMapping;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@PostMapping(\"/greetings\")\n" +
|
|
|
|
|
"public void createGreetings() {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@PostMapping(\"/greetings\")", "Path: [/greetings](http://cfapps.io:999/greetings)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testPostMappingHoverHintMethod2() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.String com.example.RestApi.createGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.PostMapping;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@PostMapping(\"/greetings\")\n" +
|
|
|
|
|
"public void createGreetings() {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertNoHover("@PostMapping(\"/greetings\")");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testPutMappingHoverHintMethod1() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[PUT]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public void com.example.RestApi.updateGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.PutMapping;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@PutMapping(\"/greetings\")\n" +
|
|
|
|
|
"public void updateGreetings() {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@PutMapping(\"/greetings\")", "Path: [/greetings](http://cfapps.io:999/greetings)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testPutMappingHoverHintMethod2() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.String com.example.RestApi.updateGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.PutMapping;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@PutMapping(\"/greetings\")\n" +
|
|
|
|
|
"public void updateGreetings() {\n" +
|
|
|
|
|
"public String updateGreetings(int n) {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
@@ -497,188 +270,6 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testPatchMappingHoverHintMethod1() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[PATCH]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public void com.example.RestApi.patchGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.PatchMapping;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@PatchMapping(\"/greetings\")\n" +
|
|
|
|
|
"public void patchGreetings() {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@PatchMapping(\"/greetings\")", "Path: [/greetings](http://cfapps.io:999/greetings)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testPatchMappingHoverHintMethod2() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.String com.example.RestApi.patchGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.PatchMapping;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@PatchMapping(\"/greetings\")\n" +
|
|
|
|
|
"public void patchGreetings() {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertNoHover("@PatchMapping(\"/greetings\")");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testMultiRequestMethodMappingHoverHintMethod1() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[POST,PUT]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public void com.example.RestApi.updateGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMapping;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMethod.*;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@RequestMapping(value=\"/greetings\", method={POST, PUT})\n" +
|
|
|
|
|
"public void updateGreetings() {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/greetings\", method={POST, PUT})", "Path: [/greetings](http://cfapps.io:999/greetings)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testMultiRequestMethodMappingHoverHintMethod2() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings],methods=[POST,PUT,PATCH]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.String com.example.RestApi.updateGreetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMapping;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMethod.*;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@RequestMapping(value=\"/greetings\", method={POST, PUT})\n" +
|
|
|
|
|
"public void updateGreetings() {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertNoHover("@RequestMapping(value=\"/greetings\", method={POST, PUT})");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testMultiPathMappingHoverHintMethod1() throws Exception {
|
|
|
|
|
|
|
|
|
|
@@ -719,8 +310,8 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value={\"/greetings\", \"/hello\"}, method=GET)", "Path: [/greetings](http://cfapps.io:999/greetings)\n" +
|
|
|
|
|
"Path: [/hello](http://cfapps.io:999/hello)\n" +
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value={\"/greetings\", \"/hello\"}, method=GET)", "[http://cfapps.io:999/greetings](http://cfapps.io:999/greetings)\n" +
|
|
|
|
|
"[http://cfapps.io:999/hello](http://cfapps.io:999/hello)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
@@ -728,50 +319,6 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testMultiPathMappingHoverHintMethod2() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/greetings || /hello || /helloAgain],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.String com.example.RestApi.greetings()\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMapping;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMethod.*;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@RequestMapping(value={\"/greetings\", \"/hello\"}, method=GET)\n" +
|
|
|
|
|
"public String greetings() {\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertNoHover("@RequestMapping(value={\"/greetings\", \"/hello\"}, method=GET)");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testMethodMatchingHoverHintMethod1() throws Exception {
|
|
|
|
|
|
|
|
|
|
@@ -816,7 +363,7 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "Path: [/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "[http://cfapps.io:999/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
@@ -868,7 +415,7 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "Path: [/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "[http://cfapps.io:999/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
@@ -921,7 +468,7 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "Path: [/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "[http://cfapps.io:999/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
@@ -929,5 +476,280 @@ public class RequestMappingLiveHoverTest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testWildCardMethodMatchingHoverHint() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/find],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.Object com.example.RestApi.set(java.lang.String,java.util.Map<java.lang.String, java.util.Map<java.lang.String, ? extends java.lang.Integer>>)\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.http.ResponseEntity;\n" +
|
|
|
|
|
"import java.lang.String;\n" +
|
|
|
|
|
"import java.lang.Integer;\n" +
|
|
|
|
|
"import java.util.Map;\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMapping;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMethod.*;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@RequestMapping(value=\"/find\", method=GET)\n" +
|
|
|
|
|
"public Object set(String p1, Map<String, Map<String, ? extends Integer>> p2) {\n" +
|
|
|
|
|
"return null;\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "[http://cfapps.io:999/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testArrayMethodMatchingHoverHint() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/find],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.Object com.example.RestApi.set(java.lang.String[])\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.http.ResponseEntity;\n" +
|
|
|
|
|
"import java.lang.String;\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMapping;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMethod.*;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@RequestMapping(value=\"/find\", method=GET)\n" +
|
|
|
|
|
"public Object set(String[] p) {\n" +
|
|
|
|
|
"return null;\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "[http://cfapps.io:999/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testMultiDimensionalArrayMethodMatchingHoverHint() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/find],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.Object com.example.RestApi.set(java.lang.String[][])\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.http.ResponseEntity;\n" +
|
|
|
|
|
"import java.lang.String;\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMapping;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMethod.*;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@RequestMapping(value=\"/find\", method=GET)\n" +
|
|
|
|
|
"public Object set(String[][] p) {\n" +
|
|
|
|
|
"return null;\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "[http://cfapps.io:999/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testVarArgsMethodMatchingHoverHint() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build a mock running boot app
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("999")
|
|
|
|
|
.processId("76543")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"{[/find],methods=[GET]}\": {\"bean\": \"requestMappingHandlerMapping\", \"method\":\"public java.lang.Object com.example.RestApi.set(java.lang.String...)\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditor(LanguageId.JAVA,
|
|
|
|
|
"package com.example;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"import org.springframework.http.ResponseEntity;\n" +
|
|
|
|
|
"import java.lang.String;\n" +
|
|
|
|
|
"import org.springframework.stereotype.Controller;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMapping;\n" +
|
|
|
|
|
"import org.springframework.web.bind.annotation.RequestMethod.*;\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@Controller\n" +
|
|
|
|
|
"public class RestApi {\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"@RequestMapping(value=\"/find\", method=GET)\n" +
|
|
|
|
|
"public Object set(String... p) {\n" +
|
|
|
|
|
"return null;\n" +
|
|
|
|
|
"}\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"}",
|
|
|
|
|
docUri);
|
|
|
|
|
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(value=\"/find\", method=GET)", "[http://cfapps.io:999/find](http://cfapps.io:999/find)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 76543\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void testMultipleAppsLiveHover() throws Exception {
|
|
|
|
|
|
|
|
|
|
File directory = new File(
|
|
|
|
|
ProjectsHarness.class.getResource("/test-projects/test-request-mapping-live-hover/").toURI());
|
|
|
|
|
String docUri = "file://" +directory.getAbsolutePath() + "/src/main/java/example/RestApi.java";
|
|
|
|
|
|
|
|
|
|
// Build three different instances of the same app running on different ports with different process IDs
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("1000")
|
|
|
|
|
.processId("70000")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"/webjars/**\":{\"bean\":\"resourceHandlerMapping\"},\"/**\":{\"bean\":\"resourceHandlerMapping\"},\"/**/favicon.ico\":{\"bean\":\"faviconHandlerMapping\"},\"{[/hello-world],methods=[GET]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public example.Greeting example.HelloWorldController.sayHello(java.lang.String)\"},\"{[/goodbye]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public java.lang.String example.RestApi.goodbye()\"},\"{[/hello]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public java.lang.String example.RestApi.hello()\"},\"{[/error]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)\"},\"{[/error],produces=[text/html]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("1001")
|
|
|
|
|
.processId("80000")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"/webjars/**\":{\"bean\":\"resourceHandlerMapping\"},\"/**\":{\"bean\":\"resourceHandlerMapping\"},\"/**/favicon.ico\":{\"bean\":\"faviconHandlerMapping\"},\"{[/hello-world],methods=[GET]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public example.Greeting example.HelloWorldController.sayHello(java.lang.String)\"},\"{[/goodbye]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public java.lang.String example.RestApi.goodbye()\"},\"{[/hello]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public java.lang.String example.RestApi.hello()\"},\"{[/error]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)\"},\"{[/error],produces=[text/html]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
|
|
|
|
|
mockAppProvider.builder()
|
|
|
|
|
.isSpringBootApp(true)
|
|
|
|
|
.port("1002")
|
|
|
|
|
.processId("90000")
|
|
|
|
|
.host("cfapps.io")
|
|
|
|
|
.processName("test-request-mapping-live-hover")
|
|
|
|
|
// Ugly, but this is real JSON copied from a real live running app. We want the
|
|
|
|
|
// mock app to return realistic results if possible
|
|
|
|
|
.getRequestMappings(
|
|
|
|
|
"{\"/webjars/**\":{\"bean\":\"resourceHandlerMapping\"},\"/**\":{\"bean\":\"resourceHandlerMapping\"},\"/**/favicon.ico\":{\"bean\":\"faviconHandlerMapping\"},\"{[/hello-world],methods=[GET]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public example.Greeting example.HelloWorldController.sayHello(java.lang.String)\"},\"{[/goodbye]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public java.lang.String example.RestApi.goodbye()\"},\"{[/hello]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public java.lang.String example.RestApi.hello()\"},\"{[/error]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)\"},\"{[/error],produces=[text/html]}\":{\"bean\":\"requestMappingHandlerMapping\",\"method\":\"public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)\"}}")
|
|
|
|
|
. build();
|
|
|
|
|
harness.intialize(directory);
|
|
|
|
|
|
|
|
|
|
Editor editor = harness.newEditorFromFileUri(docUri, LanguageId.JAVA);
|
|
|
|
|
editor.assertHoverContains("@RequestMapping(\"/hello\")", "[http://cfapps.io:1000/hello](http://cfapps.io:1000/hello)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 70000\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"---\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"[http://cfapps.io:1001/hello](http://cfapps.io:1001/hello)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 80000\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"---\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"[http://cfapps.io:1002/hello](http://cfapps.io:1002/hello)\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process ID: 90000\n" +
|
|
|
|
|
"\n" +
|
|
|
|
|
"Process Name: test-request-mapping-live-hover");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|