@Test void testingProject(final WebTarget target) throws IOException { final ProjectModel projectModel = new ProjectModel(); projectModel.setFacets(singletonList("Talend Component Kit Testing")); final Map<String, String> files = createZip(projectModel, target); assertEquals(Stream .of("application/", "application/src/test/resources/", "application/src/", "application/mvnw.cmd", "application/mvnw", "application/.mvn/", "application/.mvn/wrapper/maven-wrapper.properties", "application/.mvn/wrapper/", "application/.mvn/wrapper/maven-wrapper.jar", "application/src/test/", "application/src/test/resources/log4j2.xml", "application/pom.xml", "application/README.adoc") .collect(toSet()), files.keySet()); Stream .of("component-api", "<source>1.8</source>", "<trimStackTrace>false</trimStackTrace>") .forEach(token -> assertTrue(files.get("application/pom.xml").contains(token), token)); assertEquals("= A Talend generated Component Starter Project\n" + "\n" + "== Test\n" + "\n" + "=== Talend Component Kit Testing\n" + "\n" + "Talend Component Kit Testing skeleton generator. For each component selected it generates an associated test suffixed with `Test`.\n" + "\n" + "\n", files.get("application/README.adoc")); }
@POST @Path("zip/form") @Produces("application/zip") public Response createZip(@FormParam("project") final String compressedModel, @Context final Providers providers) { final ProjectModel model = readProjectModel(compressedModel, providers); final String filename = ofNullable(model.getArtifact()).orElse("zip") + ".zip"; return Response.ok().entity((StreamingOutput) out -> { generator.generate(toRequest(model), out); out.flush(); }).header("Content-Disposition", "inline; filename=" + filename).build(); }
ProjectResource { @POST @Path("zip/form") @Produces("application/zip") public Response createZip(@FormParam("project") final String compressedModel, @Context final Providers providers) { final ProjectModel model = readProjectModel(compressedModel, providers); final String filename = ofNullable(model.getArtifact()).orElse("zip") + ".zip"; return Response.ok().entity((StreamingOutput) out -> { generator.generate(toRequest(model), out); out.flush(); }).header("Content-Disposition", "inline; filename=" + filename).build(); } }
ProjectResource { @POST @Path("zip/form") @Produces("application/zip") public Response createZip(@FormParam("project") final String compressedModel, @Context final Providers providers) { final ProjectModel model = readProjectModel(compressedModel, providers); final String filename = ofNullable(model.getArtifact()).orElse("zip") + ".zip"; return Response.ok().entity((StreamingOutput) out -> { generator.generate(toRequest(model), out); out.flush(); }).header("Content-Disposition", "inline; filename=" + filename).build(); }  }
ProjectResource { @POST @Path("zip/form") @Produces("application/zip") public Response createZip(@FormParam("project") final String compressedModel, @Context final Providers providers) { final ProjectModel model = readProjectModel(compressedModel, providers); final String filename = ofNullable(model.getArtifact()).orElse("zip") + ".zip"; return Response.ok().entity((StreamingOutput) out -> { generator.generate(toRequest(model), out); out.flush(); }).header("Content-Disposition", "inline; filename=" + filename).build(); }  @GET @Path("configuration") @Produces(MediaType.APPLICATION_JSON) FactoryConfiguration getConfiguration(); @POST @Path("github") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Result createOnGithub(final GithubProject project); @POST @Path("openapi/github") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Result createOpenAPIOnGithub(final GithubProject project); @POST @Path("zip/form") @Produces("application/zip") Response createZip(@FormParam("project") final String compressedModel, @Context final Providers providers); @POST @Path("openapi/zip/form") @Produces("application/zip") Response createOpenAPIZip(@FormParam("project") final String compressedModel,
            @Context final Providers providers); @POST @Path("zip") @Produces("application/zip") @Consumes(MediaType.APPLICATION_JSON) StreamingOutput createZip(final ProjectModel model); @POST @Path("openapi/zip") @Produces("application/zip") @Consumes(MediaType.APPLICATION_JSON) StreamingOutput createOpenAPIZip(final ProjectModel model); }
ProjectResource { @POST @Path("zip/form") @Produces("application/zip") public Response createZip(@FormParam("project") final String compressedModel, @Context final Providers providers) { final ProjectModel model = readProjectModel(compressedModel, providers); final String filename = ofNullable(model.getArtifact()).orElse("zip") + ".zip"; return Response.ok().entity((StreamingOutput) out -> { generator.generate(toRequest(model), out); out.flush(); }).header("Content-Disposition", "inline; filename=" + filename).build(); }  @GET @Path("configuration") @Produces(MediaType.APPLICATION_JSON) FactoryConfiguration getConfiguration(); @POST @Path("github") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Result createOnGithub(final GithubProject project); @POST @Path("openapi/github") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Result createOpenAPIOnGithub(final GithubProject project); @POST @Path("zip/form") @Produces("application/zip") Response createZip(@FormParam("project") final String compressedModel, @Context final Providers providers); @POST @Path("openapi/zip/form") @Produces("application/zip") Response createOpenAPIZip(@FormParam("project") final String compressedModel,
            @Context final Providers providers); @POST @Path("zip") @Produces("application/zip") @Consumes(MediaType.APPLICATION_JSON) StreamingOutput createZip(final ProjectModel model); @POST @Path("openapi/zip") @Produces("application/zip") @Consumes(MediaType.APPLICATION_JSON) StreamingOutput createOpenAPIZip(final ProjectModel model);  }