@Test public void testGetClass() throws Exception { Response res = javaService.getClass(JavaService.class.getName()); Object entity = res.getEntity(); assertEquals(byte[].class, entity.getClass()); JavaClass javaClass = Json.mapper().readValue((byte[]) entity, JavaClass.class); assertEquals(JavaService.class.getName(), javaClass.getClassName()); }
@GET @Path("/class") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Inspect Class", description ="Inspect a Java Class with specified fully qualified class name and return a Document object") @ApiResponses(@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = JavaClass.class)), description = "Return a Document object represented by JavaClass")) public Response getClass(@Parameter(description = "The fully qualified class name to inspect") @QueryParam("className") String className) { ClassInspectionService classInspectionService = new ClassInspectionService(); classInspectionService.setConversionService(DefaultAtlasConversionService.getInstance()); JavaClass c = classInspectionService.inspectClass(className, CollectionType.NONE, null); classInspectionService = null; return Response.ok().entity(toJson(c)).build(); }
JavaService { @GET @Path("/class") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Inspect Class", description ="Inspect a Java Class with specified fully qualified class name and return a Document object") @ApiResponses(@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = JavaClass.class)), description = "Return a Document object represented by JavaClass")) public Response getClass(@Parameter(description = "The fully qualified class name to inspect") @QueryParam("className") String className) { ClassInspectionService classInspectionService = new ClassInspectionService(); classInspectionService.setConversionService(DefaultAtlasConversionService.getInstance()); JavaClass c = classInspectionService.inspectClass(className, CollectionType.NONE, null); classInspectionService = null; return Response.ok().entity(toJson(c)).build(); } }
JavaService { @GET @Path("/class") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Inspect Class", description ="Inspect a Java Class with specified fully qualified class name and return a Document object") @ApiResponses(@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = JavaClass.class)), description = "Return a Document object represented by JavaClass")) public Response getClass(@Parameter(description = "The fully qualified class name to inspect") @QueryParam("className") String className) { ClassInspectionService classInspectionService = new ClassInspectionService(); classInspectionService.setConversionService(DefaultAtlasConversionService.getInstance()); JavaClass c = classInspectionService.inspectClass(className, CollectionType.NONE, null); classInspectionService = null; return Response.ok().entity(toJson(c)).build(); }  }
JavaService { @GET @Path("/class") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Inspect Class", description ="Inspect a Java Class with specified fully qualified class name and return a Document object") @ApiResponses(@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = JavaClass.class)), description = "Return a Document object represented by JavaClass")) public Response getClass(@Parameter(description = "The fully qualified class name to inspect") @QueryParam("className") String className) { ClassInspectionService classInspectionService = new ClassInspectionService(); classInspectionService.setConversionService(DefaultAtlasConversionService.getInstance()); JavaClass c = classInspectionService.inspectClass(className, CollectionType.NONE, null); classInspectionService = null; return Response.ok().entity(toJson(c)).build(); }  @GET @Path("/simple") @Produces(MediaType.TEXT_PLAIN) @Operation(summary = "Simple", description ="Simple hello service") @ApiResponses(@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = String.class)), description = "Return a response")) String simpleHelloWorld(@Parameter(description = "From") @QueryParam("from") String from); @GET @Path("/class") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Inspect Class", description ="Inspect a Java Class with specified fully qualified class name and return a Document object") @ApiResponses(@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = JavaClass.class)), description = "Return a Document object represented by JavaClass")) Response getClass(@Parameter(description = "The fully qualified class name to inspect") @QueryParam("className") String className); @POST @Path("/mavenclasspath") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Generate Maven Classpath", description ="Retrieve a maven classpath string") @RequestBody(description = "MavenClasspathRequest object", content = @Content(schema = @Schema(implementation = MavenClasspathRequest.class))) @ApiResponses(@ApiResponse( responseCode = "200", content = @Content(schema = @Schema(implementation = MavenClasspathResponse.class)), description = "Return a MavenClasspathResponse object which contains classpath string")) Response generateClasspath(InputStream requestIn); @POST @Path("/class") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Inspect Class", description ="Inspect a Java Class with specified fully qualified class name and return a Document object") @RequestBody(description = "MavenClasspathRequest object", content = @Content(schema = @Schema(implementation = MavenClasspathRequest.class))) @ApiResponses(@ApiResponse( responseCode = "200", content = @Content(schema = @Schema(implementation = JavaClass.class)), description = "Return a Document object represented by JavaClass")) Response inspectClass(InputStream requestIn); }
JavaService { @GET @Path("/class") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Inspect Class", description ="Inspect a Java Class with specified fully qualified class name and return a Document object") @ApiResponses(@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = JavaClass.class)), description = "Return a Document object represented by JavaClass")) public Response getClass(@Parameter(description = "The fully qualified class name to inspect") @QueryParam("className") String className) { ClassInspectionService classInspectionService = new ClassInspectionService(); classInspectionService.setConversionService(DefaultAtlasConversionService.getInstance()); JavaClass c = classInspectionService.inspectClass(className, CollectionType.NONE, null); classInspectionService = null; return Response.ok().entity(toJson(c)).build(); }  @GET @Path("/simple") @Produces(MediaType.TEXT_PLAIN) @Operation(summary = "Simple", description ="Simple hello service") @ApiResponses(@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = String.class)), description = "Return a response")) String simpleHelloWorld(@Parameter(description = "From") @QueryParam("from") String from); @GET @Path("/class") @Produces(MediaType.APPLICATION_JSON) @Operation(summary = "Inspect Class", description ="Inspect a Java Class with specified fully qualified class name and return a Document object") @ApiResponses(@ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = JavaClass.class)), description = "Return a Document object represented by JavaClass")) Response getClass(@Parameter(description = "The fully qualified class name to inspect") @QueryParam("className") String className); @POST @Path("/mavenclasspath") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Generate Maven Classpath", description ="Retrieve a maven classpath string") @RequestBody(description = "MavenClasspathRequest object", content = @Content(schema = @Schema(implementation = MavenClasspathRequest.class))) @ApiResponses(@ApiResponse( responseCode = "200", content = @Content(schema = @Schema(implementation = MavenClasspathResponse.class)), description = "Return a MavenClasspathResponse object which contains classpath string")) Response generateClasspath(InputStream requestIn); @POST @Path("/class") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Inspect Class", description ="Inspect a Java Class with specified fully qualified class name and return a Document object") @RequestBody(description = "MavenClasspathRequest object", content = @Content(schema = @Schema(implementation = MavenClasspathRequest.class))) @ApiResponses(@ApiResponse( responseCode = "200", content = @Content(schema = @Schema(implementation = JavaClass.class)), description = "Return a Document object represented by JavaClass")) Response inspectClass(InputStream requestIn);  }