Skip to content

Commit

Permalink
Upgrade to Quarkus 2.5.4.Final (#169)
Browse files Browse the repository at this point in the history
* comment tests

* Fix tests

* Fix tests

* Restore main code and upgrade quarkus

* Upgrade commons-rest version
  • Loading branch information
carlosthe19916 authored Jan 10, 2022
1 parent 25823d7 commit 98d5b4a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 15 deletions.
17 changes: 12 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus-plugin.version>1.12.2.Final</quarkus-plugin.version>
<quarkus-plugin.version>2.5.4.Final</quarkus-plugin.version>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.12.2.Final</quarkus.platform.version>
<quarkus.platform.version>2.5.4.Final</quarkus.platform.version>
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
<mapstruct.version>1.4.2.Final</mapstruct.version>
<lombok.version>1.18.20</lombok.version>
Expand Down Expand Up @@ -105,12 +105,12 @@
<dependency>
<groupId>com.github.konveyor.tackle-commons-rest</groupId>
<artifactId>commons-rest</artifactId>
<version>0.0.1</version>
<version>0.0.2</version>
</dependency>
<dependency>
<groupId>com.github.konveyor.tackle-commons-rest</groupId>
<artifactId>commons-rest-test</artifactId>
<version>0.0.1</version>
<version>0.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -251,7 +251,7 @@
<properties>
<quarkus.package.type>native</quarkus.package.type>
<quarkus.container-image.tag>${quarkus.application.version:latest}-native</quarkus.container-image.tag>
<quarkus.jib.base-native-image>registry.access.redhat.com/ubi8-minimal@sha256:4d6547bbb7c5fe0f0d37b491c0c1975ff96bf4cf1c26dd665e3a5d70918b5564</quarkus.jib.base-native-image>
<quarkus.native.builder-image>quay.io/quarkus/ubi-quarkus-mandrel:21.3-java11</quarkus.native.builder-image>
</properties>
</profile>
<profile>
Expand Down Expand Up @@ -289,6 +289,13 @@
</plugins>
</build>
</profile>
<profile>
<id>container-image</id>
<properties>
<quarkus.container-image.build>true</quarkus.container-image.build>
<quarkus.jib.base-native-image>registry.access.redhat.com/ubi8-minimal@sha256:4d6547bbb7c5fe0f0d37b491c0c1975ff96bf4cf1c26dd665e3a5d70918b5564</quarkus.jib.base-native-image>
</properties>
</profile>
<profile>
<id>podman</id>
<activation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public AssessmentHeaderDto copyAssessment(@NotNull Long assessmentId, @NotNull L
}

@Transactional
private AssessmentQuestionnaire copyQuestionnaireBetweenAssessments(Assessment sourceAssessment, Assessment targetAssessment) {
protected AssessmentQuestionnaire copyQuestionnaireBetweenAssessments(Assessment sourceAssessment, Assessment targetAssessment) {
AssessmentQuestionnaire questionnaire = AssessmentQuestionnaire.builder()
.assessment(targetAssessment)
.questionnaire(sourceAssessment.assessmentQuestionnaire.questionnaire)
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ quarkus.oidc.auth-server-url=http://keycloak:8080/auth/realms/quarkus
quarkus.oidc.client-id=backend-service
quarkus.oidc.credentials.secret=secret
quarkus.oidc.tls.verification=none
quarkus.oidc.discovery-enabled=false
quarkus.oidc.jwks-path=protocol/openid-connect/certs

# Kubernetes / Openshift
quarkus.kubernetes.part-of=tackle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.tackle.pathfinder.model.questionnaire.Questionnaire;
import io.tackle.pathfinder.services.AssessmentSvc;
import lombok.extern.java.Log;
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.context.ManagedExecutor;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -1333,7 +1334,7 @@ public void given_ApplicationsAssessed_When_Confidence_Then_ResultIsTheExpected(

@Test
public void given_AssessmentAndTranslations_when_TranslationDeleted_then_ThatConceptHasTheNotTranslatedVallue() {
String KEYCLOAK_SERVER_URL = System.getProperty("quarkus.oidc.auth-server-url", "http://localhost:8180/auth");
String KEYCLOAK_SERVER_URL = ConfigProvider.getConfig().getOptionalValue("quarkus.oidc.auth-server-url", String.class).orElse("http://localhost:8180/auth");
String ACCESS_TOKEN_JDOE = RestAssured.given().relaxedHTTPSValidation()
.auth().preemptive()
.basic("backend-service", "secret")
Expand Down
26 changes: 18 additions & 8 deletions src/test/java/io/tackle/pathfinder/services/AssessmentSvcTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public void given_CreatedAssessment_When_UpdateWithStakeholdersEmpty_Then_ItDele
}

@Transactional
private boolean getCheckedForOption(Assessment assessment, Long categoryId, Long questionId, Long optionId) {
public boolean getCheckedForOption(Assessment assessment, Long categoryId, Long questionId, Long optionId) {
log.info("categories to check " + assessment.assessmentQuestionnaire.categories.size());
log.info("categories to check " + assessment.assessmentQuestionnaire.categories.stream().map(e -> e.id.toString()).collect(Collectors.joining(" ## ")));

Expand All @@ -266,7 +266,7 @@ private boolean getCheckedForOption(Assessment assessment, Long categoryId, Long
}

@Transactional
private void addStakeholdersToAssessment(Assessment assessment) {
public void addStakeholdersToAssessment(Assessment assessment) {
AssessmentStakeholder stakeholder = AssessmentStakeholder.builder().assessment(assessment).stakeholderId(100L).build();
stakeholder.persist();
assessment.stakeholders.add(stakeholder);
Expand Down Expand Up @@ -300,8 +300,13 @@ public void given_SameApplication_when_SeveralAssessmentCreation_should_ThrowExc
Assessment assessment = createAssessment(questionnaire, 57L);
transaction.commit();
return assessment;
} catch (Exception exc) {
return null;
} catch (Throwable exc) {
try {
transaction.rollback();
} catch (SystemException e) {
e.printStackTrace();
}
throw new CompletionException(exc);
}
});
Thread.sleep(500);
Expand All @@ -311,7 +316,12 @@ public void given_SameApplication_when_SeveralAssessmentCreation_should_ThrowExc
Assessment assessment = createAssessment(questionnaire, 57L);
transaction.commit();
return assessment;
} catch (Exception exc) {
} catch (Throwable exc) {
try {
transaction.rollback();
} catch (SystemException e) {
e.printStackTrace();
}
throw new CompletionException(exc);
}
});
Expand Down Expand Up @@ -558,7 +568,7 @@ public Questionnaire createQuestionnaire(String title) {
}

@Transactional
private Category createCategory(Questionnaire questionnaire, int order) {
public Category createCategory(Questionnaire questionnaire, int order) {
Category category = Category.builder()
.name("category-" + order)
.order(order)
Expand All @@ -572,7 +582,7 @@ private Category createCategory(Questionnaire questionnaire, int order) {
}

@Transactional
private Question createQuestion(Category category, int i) {
public Question createQuestion(Category category, int i) {
Question question = Question.builder()
.name("question-" + i)
.order(i)
Expand All @@ -590,7 +600,7 @@ private Question createQuestion(Category category, int i) {
}

@Transactional
private SingleOption createSingleOption(Question question, int i) {
public SingleOption createSingleOption(Question question, int i) {
SingleOption single = SingleOption.builder()
.option("option-" + i)
.order(i)
Expand Down

0 comments on commit 98d5b4a

Please sign in to comment.