itests/camel-k-itests-knative-env-from-properties/src/main/java/org/apache/camel/k/quarkus/it/KnativeEnvFromPropertiesApplication.java [40:63]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Inject
    CamelContext context;
    @Inject
    FluentProducerTemplate template;

    @GET
    @Path("/inspect")
    @Produces(MediaType.APPLICATION_JSON)
    public String inspect() {
        return context.getEndpoint("knative:endpoint/from", KnativeEndpoint.class)
            .getConfiguration()
            .getEnvironment()
            .lookup(Knative.Type.endpoint, "from")
                .filter(entry -> Objects.equals(Knative.EndpointKind.source, entry.getEndpointKind()))
                .findFirst()
                .map(def -> JsonbBuilder.create().toJson(def))
                .orElseThrow(IllegalArgumentException::new);
    }

    @POST
    @Path("/execute")
    @Produces(MediaType.TEXT_PLAIN)
    public String execute(String payload) {
        return template.to("direct:process").withBody(payload).request(String.class);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



itests/camel-k-itests-knative-env-from-registry/src/main/java/org/apache/camel/k/quarkus/it/KnativeEnvFromRegistryApplication.java [42:65]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Inject
    CamelContext context;
    @Inject
    FluentProducerTemplate template;

    @GET
    @Path("/inspect")
    @Produces(MediaType.APPLICATION_JSON)
    public String inspect() {
        return context.getEndpoint("knative:endpoint/from", KnativeEndpoint.class)
            .getConfiguration()
            .getEnvironment()
            .lookup(Knative.Type.endpoint, "from")
                .filter(entry -> Objects.equals(Knative.EndpointKind.source, entry.getEndpointKind()))
                .findFirst()
                .map(def -> JsonbBuilder.create().toJson(def))
                .orElseThrow(IllegalArgumentException::new);
    }

    @POST
    @Path("/execute")
    @Produces(MediaType.TEXT_PLAIN)
    public String execute(String payload) {
        return template.to("direct:process").withBody(payload).request(String.class);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



