From 02f34713c7ffdde323f702cc447acdf17ae8bbef Mon Sep 17 00:00:00 2001 From: Juliano Mohr Date: Fri, 8 Sep 2023 13:57:02 +0100 Subject: [PATCH] Fix s2i and liquibas --- .s2i/environment | 4 ---- README.md | 8 +++----- manifests/00-job-liquibase.yml | 2 +- .../java/app/pet/ws/WebServicePetRepositoryTest.java | 9 +++++---- 4 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 .s2i/environment diff --git a/.s2i/environment b/.s2i/environment deleted file mode 100644 index 268e159..0000000 --- a/.s2i/environment +++ /dev/null @@ -1,4 +0,0 @@ -MAVEN_S2I_ARTIFACT_DIRS=target -S2I_SOURCE_DEPLOYMENTS_FILTER=*-runner.jar lib -JAVA_OPTIONS=-Dquarkus.http.host=0.0.0.0 -AB_JOLOKIA_OFF=true diff --git a/README.md b/README.md index 54d37e2..6439c1e 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,8 @@ These instructions are intended to be used in testing and development and not fo ### JVM build -_**TODO:** Not working, fix the /.s2i script._ - ``` -oc new-build --binary=true --docker-image=registry.redhat.io/ubi8/openjdk-11 --name=quarkus --labels="app=quarkus-app" +oc new-build --binary=true --image=registry.redhat.io/ubi9/openjdk-17 --name=quarkus --labels="app=quarkus-app" oc start-build quarkus --from-dir . --follow ``` @@ -101,7 +99,7 @@ oc start-build quarkus --from-dir . --follow ``` mvn clean package -Pnative -Dquarkus.native.container-build=true -oc new-build --binary=true --docker-image=quay.io/quarkus/ubi-quarkus-native-binary-s2i:1.0 --name=quarkus-native --labels="app=quarkus-app" +oc new-build --binary=true --docker-image=quay.io/quarkus/ubi-quarkus-native-binary-s2i:2.0 --name=quarkus-native --labels="app=quarkus-app" oc start-build quarkus-native --from-file ./target/quarkus-app-1.0.1-runner --follow ``` @@ -110,7 +108,7 @@ oc start-build quarkus-native --from-file ./target/quarkus-app-1.0.1-runner --fo Once image is built and pushed to the registry, just set the image in the deployment: ``` -oc set image deployment quarkus app=$(oc get istag quarkus-native:latest -o jsonpath='{.image.dockerImageReference}') +oc set image deployment quarkus app=$(oc get istag quarkus:latest -o jsonpath='{.image.dockerImageReference}') ``` Review any steps above in [OpenShift](#OpenShift). diff --git a/manifests/00-job-liquibase.yml b/manifests/00-job-liquibase.yml index 1b42f2f..774b232 100644 --- a/manifests/00-job-liquibase.yml +++ b/manifests/00-job-liquibase.yml @@ -12,7 +12,7 @@ spec: image: docker.io/liquibase/liquibase:4.23.1-alpine args: [ - "--url=jdbc:postgresql://postgresql:5432/quarkusdb1", + "--url=jdbc:postgresql://postgresql:5432/quarkusdb", "--username=quarkus", "--password=password", "--defaultsFile=/liquibase/changelog/liquibase.properties", diff --git a/src/test/java/app/pet/ws/WebServicePetRepositoryTest.java b/src/test/java/app/pet/ws/WebServicePetRepositoryTest.java index f64026a..a10ae5c 100644 --- a/src/test/java/app/pet/ws/WebServicePetRepositoryTest.java +++ b/src/test/java/app/pet/ws/WebServicePetRepositoryTest.java @@ -3,14 +3,14 @@ import static app.pet.Pet.pet; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -import jakarta.inject.Inject; -import jakarta.ws.rs.ProcessingException; -import jakarta.ws.rs.WebApplicationException; import org.junit.jupiter.api.Test; import app.pet.PetRepository; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.TestProfile; +import jakarta.inject.Inject; +import jakarta.ws.rs.ProcessingException; +import jakarta.ws.rs.WebApplicationException; @QuarkusTest @TestProfile(WebServiceTestProfile.class) @@ -58,9 +58,10 @@ void find_pet_network_fault() { @Test void find_pet_timeout() { - assertThrows(ProcessingException.class, () -> { + var exception = assertThrows(ProcessingException.class, () -> { repository.find("timeout"); }); + assertThat(exception).hasMessageEndingWith("Read timed out"); } @Test