From 2c951f0e1f3ccb99ee73652477e53c7b0dc2bd6a Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 24 Nov 2022 10:06:43 -0500 Subject: [PATCH] Fix JAX-RS code lens test failures Closes #760 Signed-off-by: David Thompson --- .../jdt/quarkus/jaxrs/JaxRsCodeLensTest.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus.test/src/main/java/com/redhat/microprofile/jdt/quarkus/jaxrs/JaxRsCodeLensTest.java b/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus.test/src/main/java/com/redhat/microprofile/jdt/quarkus/jaxrs/JaxRsCodeLensTest.java index b3e56eb99..40f1dcad2 100644 --- a/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus.test/src/main/java/com/redhat/microprofile/jdt/quarkus/jaxrs/JaxRsCodeLensTest.java +++ b/quarkus.jdt.ext/com.redhat.microprofile.jdt.quarkus.test/src/main/java/com/redhat/microprofile/jdt/quarkus/jaxrs/JaxRsCodeLensTest.java @@ -141,7 +141,7 @@ private static void assertCodeLenses(int port, String rootPath, MicroProfileJava IJDTUtils utils) throws JavaModelException { List lenses = PropertiesManagerForJava.getInstance().codeLens(params, utils, new NullProgressMonitor()); - Assert.assertEquals(2, lenses.size()); + Assert.assertEquals(5, lenses.size()); // @GET // public Fruit[] get() { @@ -156,6 +156,33 @@ private static void assertCodeLenses(int port, String rootPath, MicroProfileJava Assert.assertNotNull(lensForGetSingle.getCommand()); Assert.assertEquals("http://localhost:" + port + rootPath + "/fruits/{id}", lensForGetSingle.getCommand().getTitle()); + + // @POST + // @Transactional + // public Response create(Fruit fruit) { + CodeLens lensForPost = lenses.get(2); + Assert.assertNotNull(lensForPost.getCommand()); + Assert.assertEquals("", lensForPost.getCommand().getCommand()); + Assert.assertEquals("http://localhost:" + port + rootPath + "/fruits", lensForPost.getCommand().getTitle()); + + // @PUT + // @Path("{id}") + // @Transactional + // public Fruit update(@PathParam Integer id, Fruit fruit) { + CodeLens lensForPut = lenses.get(3); + Assert.assertNotNull(lensForPut.getCommand()); + Assert.assertEquals("", lensForPut.getCommand().getCommand()); + Assert.assertEquals("http://localhost:" + port + rootPath + "/fruits/{id}", lensForPut.getCommand().getTitle()); + + // @DELETE + // @Path("{id}") + // @Transactional + // public Response delete(@PathParam Integer id) { + CodeLens lensForDelete = lenses.get(4); + Assert.assertNotNull(lensForDelete.getCommand()); + Assert.assertEquals("", lensForDelete.getCommand().getCommand()); + Assert.assertEquals("http://localhost:" + port + rootPath + "/fruits/{id}", + lensForDelete.getCommand().getTitle()); } } \ No newline at end of file