-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KOGITO-9757 Changed property expansion to use ${property_name} (#3188)
* KOGITO-9757 Changed property expansion to use ${property_name} Signed-off-by: Helber Belmiro <[email protected]> * KOGITO-9757 Fixed regex Signed-off-by: Helber Belmiro <[email protected]> * KOGITO-9757 Imports sorted Signed-off-by: Helber Belmiro <[email protected]> * Added kogito-quarkus-workflow-common-deployment as a test scoped dependency to kogito-addons-quarkus-kubernetes-integration-tests Signed-off-by: Helber Belmiro <[email protected]> * Added kogito-addons-quarkus-messaging-deployment as a test scoped dependency to kogito-addons-quarkus-kubernetes-integration-tests Signed-off-by: Helber Belmiro <[email protected]> * Fixed interpolation Signed-off-by: Helber Belmiro <[email protected]> * Fixed interpolation Signed-off-by: Helber Belmiro <[email protected]> --------- Signed-off-by: Helber Belmiro <[email protected]>
- Loading branch information
Showing
8 changed files
with
342 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-kubernetes-parent</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>kogito-addons-quarkus-kubernetes-integration-tests</artifactId> | ||
<name>Kogito Add-On Kubernetes - Integration Tests</name> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-quarkus-bom</artifactId> | ||
<version>${project.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-cache</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-openapi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-quarkus-serverless-workflow</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-jackson</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-kubernetes</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-fabric8-kubernetes-service-catalog</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-kubernetes</artifactId> | ||
</dependency> | ||
|
||
<!-- Test --> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-test-kubernetes-client</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-fabric8-kubernetes-service-catalog-test-utils</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-quarkus-workflow-common-deployment</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kie.kogito</groupId> | ||
<artifactId>kogito-addons-quarkus-messaging-deployment</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<configuration> | ||
<noDeps>true</noDeps> | ||
<skip>${skipTests}</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>native</id> | ||
<activation> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<quarkus.package.type>native</quarkus.package.type> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
</project> |
38 changes: 38 additions & 0 deletions
38
...ernetes/integration-tests/src/main/java/org/kie/kogito/addons/quarkus/kubernetes/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright 2023 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.kie.kogito.addons.quarkus.kubernetes; | ||
|
||
import javax.inject.Inject; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.eclipse.microprofile.config.inject.ConfigProperty; | ||
|
||
@Path("/foo") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public class Foo { | ||
|
||
@Inject | ||
@ConfigProperty(name = "my_service") | ||
String service; | ||
|
||
@GET | ||
public String getWorkflowType() { | ||
return service; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
quarkus/addons/kubernetes/integration-tests/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
my_service=${knative:services.v1.serving.knative.dev/default/serverless-workflow-greeting-quarkus}/path |
54 changes: 54 additions & 0 deletions
54
...n-tests/src/test/java/org/kie/kogito/addons/quarkus/kubernetes/ConfigValueExpanderIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2023 Red Hat, Inc. and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.kie.kogito.addons.quarkus.kubernetes; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.fabric8.kubernetes.client.server.mock.KubernetesServer; | ||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
import io.quarkus.test.kubernetes.client.KubernetesTestServer; | ||
import io.quarkus.test.kubernetes.client.WithKubernetesTestServer; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.kie.kogito.addons.quarkus.k8s.test.utils.KnativeResourceDiscoveryTestUtil.createServiceIfNotExists; | ||
|
||
@QuarkusIntegrationTest | ||
@WithKubernetesTestServer | ||
class ConfigValueExpanderIT { | ||
|
||
private static final String NAMESPACE = "default"; | ||
|
||
private static final String SERVICENAME = "serverless-workflow-greeting-quarkus"; | ||
|
||
@KubernetesTestServer | ||
KubernetesServer mockServer; | ||
|
||
@BeforeEach | ||
void beforeEach() { | ||
createServiceIfNotExists(mockServer, "knative/quarkus-greeting.yaml", NAMESPACE, SERVICENAME); | ||
} | ||
|
||
@Test | ||
void test() { | ||
given().when() | ||
.get("/foo") | ||
.then() | ||
.statusCode(200) | ||
.body(is("http://serverless-workflow-greeting-quarkus.test.10.99.154.147.sslip.io/path")); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
quarkus/addons/kubernetes/integration-tests/src/test/resources/knative/quarkus-greeting.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Service | ||
metadata: | ||
annotations: | ||
serving.knative.dev/creator: minikube-user | ||
serving.knative.dev/lastModifier: minikube-user | ||
creationTimestamp: '2022-08-17T13:58:53Z' | ||
generation: 1 | ||
name: serverless-workflow-greeting-quarkus | ||
resourceVersion: '43817' | ||
uid: 98530cb6-3274-4d0c-b654-a82645cda058 | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
client.knative.dev/updateTimestamp: '2022-08-17T13:58:53Z' | ||
client.knative.dev/user-image: kiegroup/serverless-workflow-greeting-quarkus:1.0 | ||
creationTimestamp: | ||
spec: | ||
containerConcurrency: 0 | ||
containers: | ||
- image: kiegroup/serverless-workflow-greeting-quarkus:1.0 | ||
name: user-container | ||
readinessProbe: | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: 0 | ||
resources: { } | ||
enableServiceLinks: false | ||
timeoutSeconds: 300 | ||
traffic: | ||
- latestRevision: true | ||
percent: 100 | ||
status: | ||
address: | ||
url: http://serverless-workflow-greeting-quarkus.test.svc.cluster.local | ||
conditions: | ||
- lastTransitionTime: '2022-08-17T13:59:00Z' | ||
status: 'True' | ||
type: ConfigurationsReady | ||
- lastTransitionTime: '2022-08-17T13:59:00Z' | ||
status: 'True' | ||
type: Ready | ||
- lastTransitionTime: '2022-08-17T13:59:00Z' | ||
status: 'True' | ||
type: RoutesReady | ||
latestCreatedRevisionName: serverless-workflow-greeting-quarkus-00001 | ||
latestReadyRevisionName: serverless-workflow-greeting-quarkus-00001 | ||
observedGeneration: 1 | ||
traffic: | ||
- latestRevision: true | ||
percent: 100 | ||
revisionName: serverless-workflow-greeting-quarkus-00001 | ||
url: http://serverless-workflow-greeting-quarkus.test.10.99.154.147.sslip.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.