use of org.talend.sdk.component.starter.server.model.FactoryConfiguration in project component-runtime by Talend.
the class ProjectResourceTest method configuration.
@Test
void configuration(final WebTarget target) {
final FactoryConfiguration config = target.path("project/configuration").request(MediaType.APPLICATION_JSON_TYPE).get(FactoryConfiguration.class);
final String debug = config.toString();
assertEquals(new HashSet<>(asList("Gradle", "Maven")), new HashSet<>(config.getBuildTypes()), debug);
assertEquals(new HashMap<String, List<FactoryConfiguration.Facet>>() {
{
put("Test", singletonList(new FactoryConfiguration.Facet("Talend Component Kit Testing", "Generates test(s) for each component.")));
put("Runtime", singletonList(new FactoryConfiguration.Facet("Apache Beam", "Generates some tests using beam runtime instead of Talend Component Kit Testing framework.")));
put("Libraries", singletonList(new FactoryConfiguration.Facet("WADL Client Generation", "Generates a HTTP client from a WADL.")));
put("Tool", asList(new FactoryConfiguration.Facet("Codenvy", "Pre-configures the project to be usable with Codenvy."), new FactoryConfiguration.Facet("Travis CI", "Creates a .travis.yml pre-configured for a component build.")));
}
}, new HashMap<>(config.getFacets()), debug);
}
use of org.talend.sdk.component.starter.server.model.FactoryConfiguration in project component-runtime by Talend.
the class ProjectResource method init.
@PostConstruct
private void init() {
final List<String> buildTypes = new ArrayList<>(generator.getGenerators().keySet());
buildTypes.sort(String::compareTo);
final Map<String, List<FactoryConfiguration.Facet>> facets = generator.getFacets().values().stream().collect(toMap(e -> e.category().getHumanName(), e -> new ArrayList<>(singletonList(new FactoryConfiguration.Facet(e.name(), e.description()))), (u, u2) -> {
if (u == null) {
return u2;
}
u.addAll(u2);
return u;
}, TreeMap::new));
facets.forEach((k, v) -> v.sort(Comparator.comparing(FactoryConfiguration.Facet::getName)));
configuration = new FactoryConfiguration(buildTypes, facets);
}
Aggregations