diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a90b7b40..3a22e757 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -32,10 +32,10 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: 'temurin' cache: 'maven' - name: Set Build Params diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d7ad27c4..3aaf7283 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,10 +20,10 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: 'temurin' cache: 'maven' - name: Pre-Release Check - Version @@ -132,4 +132,4 @@ jobs: export image_tag=${{ github.event.inputs.releaseVersion }} export chart_version="n/a" export sha=${{ github.sha }} - ./.github/workflows/release_scripts/update_release_manifest.sh \ No newline at end of file + ./.github/workflows/release_scripts/update_release_manifest.sh diff --git a/README.md b/README.md index 0dab8bd8..8ea28ace 100644 --- a/README.md +++ b/README.md @@ -194,7 +194,7 @@ curl -X 'POST' \ ## Prerequisites -* Java 11 (JDK 11.0.14+) +* Java 17 (JDK 17.0.8_7+) * Maven ## Cloning the GitHub Event Management Agent repository diff --git a/service/application/docker/buildEventManagementAgentDocker.sh b/service/application/docker/buildEventManagementAgentDocker.sh index 1482418d..005a0611 100755 --- a/service/application/docker/buildEventManagementAgentDocker.sh +++ b/service/application/docker/buildEventManagementAgentDocker.sh @@ -80,7 +80,7 @@ setup_colors msg "${GREEN}Building image:${YELLOW} event-management-agent:${IMAGE_TAG}\n${NOFORMAT}" -export BASE_IMAGE=eclipse-temurin:11.0.19_7-jdk-alpine +export BASE_IMAGE=eclipse-temurin:17.0.8_7-jdk-alpine export GITHASH=$(git rev-parse HEAD) export GITBRANCH=$(git branch --show-current) export BUILD_TIMESTAMP=$(date -u) diff --git a/service/application/pom.xml b/service/application/pom.xml index ce384bf5..f14400f2 100644 --- a/service/application/pom.xml +++ b/service/application/pom.xml @@ -18,7 +18,7 @@ 2.0 3.1.5 1.1.1 - 2.9.0 + 3.0.9 3.5.0 @@ -41,12 +41,12 @@ org.apache.tomcat.embed tomcat-embed-core - 9.0.75 + 10.1.11 org.springframework.boot spring-boot-autoconfigure - 2.7.12 + 3.1.2 org.springframework.boot @@ -89,10 +89,17 @@ org.springframework.boot spring-boot-starter-test test + + + ch.qos.logback + logback-classic + + org.mockito mockito-inline + ${mockito-inline.version} test @@ -110,6 +117,11 @@ camel-jackson ${camel.version} + + org.apache.camel.springboot + camel-directvm-starter + 4.0.0-M2 + com.fasterxml.jackson.core jackson-databind @@ -260,6 +272,10 @@ snakeyaml ${snakeyaml.version} + + jakarta.servlet + jakarta.servlet-api + diff --git a/service/application/src/main/java/com/solace/maas/ep/common/model/ScanRequestDTO.java b/service/application/src/main/java/com/solace/maas/ep/common/model/ScanRequestDTO.java index e2002f21..7109f604 100644 --- a/service/application/src/main/java/com/solace/maas/ep/common/model/ScanRequestDTO.java +++ b/service/application/src/main/java/com/solace/maas/ep/common/model/ScanRequestDTO.java @@ -9,7 +9,7 @@ import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; import java.util.List; @AllArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/config/CamelContextConfig.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/config/CamelContextConfig.java index 98e7e41f..94bef774 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/config/CamelContextConfig.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/config/CamelContextConfig.java @@ -1,8 +1,6 @@ package com.solace.maas.ep.event.management.agent.config; -import com.solace.maas.ep.event.management.agent.logging.CustomUnitOfWork; import org.apache.camel.CamelContext; -import org.apache.camel.ExtendedCamelContext; import org.apache.camel.spring.boot.CamelContextConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Component; @@ -16,7 +14,7 @@ public CamelContextConfiguration contextConfiguration() { @Override public void beforeApplicationStart(CamelContext context) { context.setUseMDCLogging(true); - context.adapt(ExtendedCamelContext.class).setUnitOfWorkFactory(CustomUnitOfWork::new); + context.setStreamCaching(false); } @Override diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanTypeDescendentsProcessorImpl.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanTypeDescendentsProcessorImpl.java index b8e199d1..17924ceb 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanTypeDescendentsProcessorImpl.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/processor/ScanTypeDescendentsProcessorImpl.java @@ -8,7 +8,7 @@ import org.apache.camel.Exchange; import org.springframework.stereotype.Component; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/file/DataCollectionFileEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/file/DataCollectionFileEntity.java index a8fa509d..eef3d320 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/file/DataCollectionFileEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/file/DataCollectionFileEntity.java @@ -8,16 +8,16 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import java.io.Serializable; import java.util.List; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/file/aggregation/AggregatedFileEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/file/aggregation/AggregatedFileEntity.java index 13f68dc1..a791120d 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/file/aggregation/AggregatedFileEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/file/aggregation/AggregatedFileEntity.java @@ -7,14 +7,14 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.ManyToMany; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.Table; import java.io.Serializable; import java.util.List; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportDetailsEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportDetailsEntity.java index 027ec2da..8f3dbad3 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportDetailsEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportDetailsEntity.java @@ -6,10 +6,10 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; import java.io.Serializable; @ExcludeFromJacocoGeneratedReport diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportEntity.java index 9d22d8a6..447d810c 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportEntity.java @@ -7,14 +7,14 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.OneToOne; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; import java.io.Serializable; @ExcludeFromJacocoGeneratedReport diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportFilesEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportFilesEntity.java index dd293510..2838988a 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportFilesEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/manualimport/ManualImportFilesEntity.java @@ -6,10 +6,10 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; import java.io.Serializable; @ExcludeFromJacocoGeneratedReport diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/AuthenticationDetailsEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/AuthenticationDetailsEntity.java index 89769ac1..4427745a 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/AuthenticationDetailsEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/AuthenticationDetailsEntity.java @@ -6,16 +6,16 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; import java.io.Serializable; import java.util.List; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/AuthenticationPropertiesEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/AuthenticationPropertiesEntity.java index 551f00e9..543ef6a1 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/AuthenticationPropertiesEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/AuthenticationPropertiesEntity.java @@ -7,15 +7,15 @@ import lombok.experimental.SuperBuilder; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import java.io.Serializable; @AllArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ConnectionDetailsEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ConnectionDetailsEntity.java index 78d82f38..1248a0c2 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ConnectionDetailsEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ConnectionDetailsEntity.java @@ -6,16 +6,16 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; import java.io.Serializable; import java.util.List; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ConnectionPropertiesEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ConnectionPropertiesEntity.java index 7bbc2742..9f524fda 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ConnectionPropertiesEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ConnectionPropertiesEntity.java @@ -7,15 +7,15 @@ import lombok.experimental.SuperBuilder; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import java.io.Serializable; @AllArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialDetailsEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialDetailsEntity.java index 6d07996b..a01e4211 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialDetailsEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialDetailsEntity.java @@ -6,16 +6,16 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; import java.io.Serializable; import java.util.List; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialOperationsEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialOperationsEntity.java index 93264e28..3abf4bd9 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialOperationsEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialOperationsEntity.java @@ -6,15 +6,15 @@ import lombok.experimental.SuperBuilder; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import java.io.Serializable; @AllArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialPropertiesEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialPropertiesEntity.java index cd13c04e..f577be54 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialPropertiesEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/CredentialPropertiesEntity.java @@ -7,15 +7,15 @@ import lombok.experimental.SuperBuilder; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import java.io.Serializable; @AllArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/MessagingServiceEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/MessagingServiceEntity.java index f16302c2..8bb6aa5e 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/MessagingServiceEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/MessagingServiceEntity.java @@ -7,13 +7,13 @@ import lombok.NoArgsConstructor; import lombok.ToString; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; import java.io.Serializable; import java.util.List; import java.util.Objects; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ServiceAssociationsCompositeKey.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ServiceAssociationsCompositeKey.java index 76d2228a..09ef7058 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ServiceAssociationsCompositeKey.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ServiceAssociationsCompositeKey.java @@ -5,10 +5,10 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.CascadeType; -import javax.persistence.Embeddable; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Embeddable; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; import java.io.Serializable; @AllArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ServiceAssociationsEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ServiceAssociationsEntity.java index bf0f4fc1..6ec0af7f 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ServiceAssociationsEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/mesagingservice/ServiceAssociationsEntity.java @@ -5,9 +5,9 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.EmbeddedId; -import javax.persistence.Entity; -import javax.persistence.Table; +import jakarta.persistence.EmbeddedId; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; @AllArgsConstructor @NoArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/route/RouteEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/route/RouteEntity.java index 06fc8dd0..93aeacad 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/route/RouteEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/route/RouteEntity.java @@ -7,13 +7,13 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.ManyToMany; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.Table; import java.io.Serializable; import java.util.List; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/AsyncScanProcessEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/AsyncScanProcessEntity.java index 7452c734..531bfa9f 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/AsyncScanProcessEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/AsyncScanProcessEntity.java @@ -5,10 +5,10 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; @AllArgsConstructor @NoArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanDestinationEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanDestinationEntity.java index 340c446e..df40dfa0 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanDestinationEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanDestinationEntity.java @@ -8,15 +8,15 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import java.io.Serializable; @ExcludeFromJacocoGeneratedReport diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanEntity.java index 04a62d35..6983c5aa 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanEntity.java @@ -11,17 +11,17 @@ import org.hibernate.annotations.CreationTimestamp; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityListeners; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToMany; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; import java.io.Serializable; import java.time.Instant; import java.util.List; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientEntity.java index fd5649bd..191f1cb5 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientEntity.java @@ -7,15 +7,15 @@ import lombok.NoArgsConstructor; import org.hibernate.annotations.GenericGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import java.io.Serializable; @AllArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientHierarchyEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientHierarchyEntity.java index 78650ca3..fe3be2b7 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientHierarchyEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientHierarchyEntity.java @@ -5,14 +5,14 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.CollectionTable; -import javax.persistence.Column; -import javax.persistence.ElementCollection; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.MapKeyColumn; -import javax.persistence.Table; +import jakarta.persistence.CollectionTable; +import jakarta.persistence.Column; +import jakarta.persistence.ElementCollection; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.MapKeyColumn; +import jakarta.persistence.Table; import java.util.Map; @AllArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientStoreEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientStoreEntity.java index 696645cf..39a7aa9c 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientStoreEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanRecipientStoreEntity.java @@ -5,10 +5,10 @@ import lombok.Data; import lombok.NoArgsConstructor; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; @AllArgsConstructor @NoArgsConstructor diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanStatusEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanStatusEntity.java index 1a018904..9e59dda7 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanStatusEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanStatusEntity.java @@ -7,14 +7,14 @@ import lombok.NoArgsConstructor; import lombok.ToString; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.OneToOne; -import javax.persistence.Table; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; import java.io.Serializable; @ExcludeFromJacocoGeneratedReport diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanTypeEntity.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanTypeEntity.java index f5d0cb2a..27263bb1 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanTypeEntity.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/repository/model/scan/ScanTypeEntity.java @@ -1,6 +1,16 @@ package com.solace.maas.ep.event.management.agent.repository.model.scan; import com.solace.maas.ep.event.management.agent.plugin.jacoco.ExcludeFromJacocoGeneratedReport; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -8,16 +18,6 @@ import lombok.ToString; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityListeners; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToOne; -import javax.persistence.Table; import java.io.Serializable; @ExcludeFromJacocoGeneratedReport diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/scanManager/rest/EMAController.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/scanManager/rest/EMAController.java index ca5dc544..63dd6d46 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/scanManager/rest/EMAController.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/scanManager/rest/EMAController.java @@ -10,7 +10,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import org.springframework.http.ResponseEntity; -import javax.validation.Valid; +import jakarta.validation.Valid; public interface EMAController { diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/scanManager/rest/EMAControllerImpl.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/scanManager/rest/EMAControllerImpl.java index cc59a33a..2f6dc165 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/scanManager/rest/EMAControllerImpl.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/scanManager/rest/EMAControllerImpl.java @@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.validation.Valid; +import jakarta.validation.Valid; import java.util.List; @Slf4j diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/service/MessagingServiceDelegateServiceImpl.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/service/MessagingServiceDelegateServiceImpl.java index 8803f1a5..ffd8e33d 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/service/MessagingServiceDelegateServiceImpl.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/service/MessagingServiceDelegateServiceImpl.java @@ -16,7 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.transaction.Transactional; +import jakarta.transaction.Transactional; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/subscriber/SolaceMessageHandler.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/subscriber/SolaceMessageHandler.java index e96ae696..79105bfb 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/subscriber/SolaceMessageHandler.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/subscriber/SolaceMessageHandler.java @@ -60,7 +60,7 @@ public void onMessage(InboundMessage inboundMessage) { try { Class messageClass = cachedJSONDecoders.get(mopMessageSubclass); - T message = null; + T message; if (messageClass == null) { messageClass = Class.forName(mopMessageSubclass); diff --git a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/util/IDGenerator.java b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/util/IDGenerator.java index afbe46dc..2d6417e8 100644 --- a/service/application/src/main/java/com/solace/maas/ep/event/management/agent/util/IDGenerator.java +++ b/service/application/src/main/java/com/solace/maas/ep/event/management/agent/util/IDGenerator.java @@ -8,7 +8,7 @@ import org.springframework.stereotype.Component; import org.springframework.util.DigestUtils; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.nio.charset.StandardCharsets; import java.security.SecureRandom; import java.util.Random; diff --git a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/handler/base/AsyncRoutePublisherImplTests.java b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/handler/base/AsyncRoutePublisherImplTests.java index 0ef05525..70c2fd5c 100644 --- a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/handler/base/AsyncRoutePublisherImplTests.java +++ b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/handler/base/AsyncRoutePublisherImplTests.java @@ -32,6 +32,7 @@ @EnableAutoConfiguration @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = TestConfig.class) @Slf4j +@SuppressWarnings("PMD.CloseResource") public class AsyncRoutePublisherImplTests { CamelContext camelContext = mock(CamelContext.class); @@ -44,7 +45,10 @@ public class AsyncRoutePublisherImplTests { public void testStart() { AsyncWrapper asyncWrapper = mock(AsyncWrapper.class); - Exchange exchange = ExchangeBuilder.anExchange(mock(ExtendedCamelContext.class)) + CamelContext cc = mock(CamelContext.class); + when(cc.getCamelContextExtension()) + .thenReturn(mock(ExtendedCamelContext.class)); + Exchange exchange = ExchangeBuilder.anExchange(cc) .withHeader(RouteConstants.SCAN_ID, "scan1") .withHeader(RouteConstants.SCAN_TYPE, "testScan") .build(); @@ -70,17 +74,24 @@ public void testStart() { @Test @SneakyThrows public void testSendMessage() { - Exchange exchange = ExchangeBuilder.anExchange(mock(ExtendedCamelContext.class)) + CamelContext cc = mock(CamelContext.class); + when(cc.getCamelContextExtension()) + .thenReturn(mock(ExtendedCamelContext.class)); + + Exchange exchange = ExchangeBuilder.anExchange(cc) .withHeader(RouteConstants.SCAN_ID, "scan1") .withHeader(RouteConstants.SCAN_TYPE, "testScan") .build(); - try (CamelContext extendedCamelContext = mock(ExtendedCamelContext.class)) { + try (CamelContext camelContext = mock(CamelContext.class)) { + when(camelContext.getCamelContextExtension()) + .thenReturn(mock(ExtendedCamelContext.class)); + Exchange newExchange = mock(Exchange.class); Message message = mock(Message.class); when(camelReactiveStreamsService.getCamelContext()) - .thenReturn(extendedCamelContext); + .thenReturn(camelContext); try (MockedStatic reactiveStreams = mockStatic(CamelReactiveStreams.class)) { reactiveStreams.when(() -> CamelReactiveStreams.get(camelContext)) @@ -102,6 +113,7 @@ public void testSendMessage() { asyncRoutePublisher.sendMesage("test", exchange); } } + assertThatNoException(); } } diff --git a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/processor/async/AsyncManagerProcessorTests.java b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/processor/async/AsyncManagerProcessorTests.java index 6773845f..57f89e53 100644 --- a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/processor/async/AsyncManagerProcessorTests.java +++ b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/plugin/route/processor/async/AsyncManagerProcessorTests.java @@ -6,8 +6,8 @@ import com.solace.maas.ep.event.management.agent.plugin.route.manager.AsyncManager; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import org.apache.camel.CamelContext; import org.apache.camel.Exchange; -import org.apache.camel.ExtendedCamelContext; import org.apache.camel.builder.ExchangeBuilder; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; @@ -40,7 +40,7 @@ public void testProcess() { RouteConstants.SCAN_TYPE, "testScan" ); - Exchange exchange = ExchangeBuilder.anExchange(mock(ExtendedCamelContext.class)) + Exchange exchange = ExchangeBuilder.anExchange(mock(CamelContext.class)) .withBody(body) .build(); diff --git a/service/confluent-schema-registry-plugin/pom.xml b/service/confluent-schema-registry-plugin/pom.xml index 825ece0f..12ee98a9 100644 --- a/service/confluent-schema-registry-plugin/pom.xml +++ b/service/confluent-schema-registry-plugin/pom.xml @@ -8,9 +8,9 @@ Solace Event Management Agent - Confluent Schema Registry Plugin Solace Event Management Agent - Confluent Schema Registry Plugin - 11 - 11 - 2.7.6 + 17 + 17 + 3.1.2 4.5.13 4.9.0 5.3.1 @@ -29,6 +29,12 @@ spring-boot-starter-test ${spring-boot-starter-test.version} test + + + ch.qos.logback + logback-classic + + org.apache.httpcomponents diff --git a/service/kafka-plugin/pom.xml b/service/kafka-plugin/pom.xml index 9c163a19..3b9182f3 100644 --- a/service/kafka-plugin/pom.xml +++ b/service/kafka-plugin/pom.xml @@ -8,14 +8,14 @@ Solace Event Management Agent - Kafka Plugin Solace Event Management Agent - Kafka Plugin - 11 - 11 - 2.9.0 + 17 + 17 + 3.0.9 3.5.0 - 2.7.6 + 3.1.2 4.4 5.3.1 - 3.16.0 + 4.0.0-RC2 1.1.5 2.0 2.13.4 @@ -42,13 +42,17 @@ org.springframework.boot spring-boot-starter-test - ${spring-boot-starter-test.vresion} + ${spring-boot-starter-test.version} test org.yaml snakeyaml + + ch.qos.logback + logback-classic + diff --git a/service/local-storage-plugin/pom.xml b/service/local-storage-plugin/pom.xml index 5fa10a97..327b5bd6 100644 --- a/service/local-storage-plugin/pom.xml +++ b/service/local-storage-plugin/pom.xml @@ -8,15 +8,15 @@ Solace Event Management Agent - Local Storage Plugin Solace Event Management Agent - Local Storage Plugin - 11 - 11 + 17 + 17 20230227 - 3.16.0 + 4.0.0-RC2 2.0 2.13.4.2 4.13.2 - 2.7.12 - 2.7.12 + 3.1.2 + 3.1.2 4.4 5.3.1 3.3.0 diff --git a/service/plugin/pom.xml b/service/plugin/pom.xml index 8f80b673..65be71e3 100644 --- a/service/plugin/pom.xml +++ b/service/plugin/pom.xml @@ -14,8 +14,8 @@ Solace Event Management Agent - Plugin Solace Event Management Agent - Plugin - 11 - 11 + ${java.version} + ${java.version} 2.0 @@ -27,17 +27,21 @@ org.yaml snakeyaml + + ch.qos.logback + logback-classic + org.apache.tomcat.embed tomcat-embed-core - 9.0.75 + 10.1.11 org.springframework.boot spring-boot-autoconfigure - 2.7.12 + 3.1.2 org.springframework.boot @@ -66,10 +70,17 @@ org.springframework.boot spring-boot-starter-test test + + + ch.qos.logback + logback-classic + + org.mockito mockito-inline + ${mockito-inline.version} test diff --git a/service/pom.xml b/service/pom.xml index e65bd741..1a19ce45 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.11 + 3.1.2 com.solace.maas @@ -23,14 +23,14 @@ application - 11 + 17 ${project.basedir}/../.git ${maven.build.timestamp} yyyyMMddHHmmss 1.2.1 3.1.0 validate - 3.13.0 + 3.21.0 validate 4.7.3.0 compile @@ -39,7 +39,8 @@ 6.6 1.5.2.Final 0.8 - 3.16.0 + 4.0.0-RC2 + 5.2.0 diff --git a/service/rabbitmq-plugin/pom.xml b/service/rabbitmq-plugin/pom.xml index 02caf004..6ec0b7b1 100644 --- a/service/rabbitmq-plugin/pom.xml +++ b/service/rabbitmq-plugin/pom.xml @@ -8,8 +8,8 @@ Solace Event Management Agent - RabbitMQ Plugin Solace Event Management Agent - RabbitMQ Plugin - 11 - 11 + 17 + 17 diff --git a/service/resources/pmd/pmd-rules.xml b/service/resources/pmd/pmd-rules.xml index 80d2c622..7db4f321 100755 --- a/service/resources/pmd/pmd-rules.xml +++ b/service/resources/pmd/pmd-rules.xml @@ -13,12 +13,14 @@ + + @@ -90,6 +92,7 @@ + diff --git a/service/solace-plugin/pom.xml b/service/solace-plugin/pom.xml index 011f839f..0b8fb7e1 100644 --- a/service/solace-plugin/pom.xml +++ b/service/solace-plugin/pom.xml @@ -8,14 +8,14 @@ Solace Event Management Agent - Solace Plugin Solace Event Management Agent - Solace Plugin - 11 - 11 + 17 + 17 1.0.0 10.0.0 - 2.7.6 - 2.7.6 + 3.1.2 + 3.1.2 5.3.1 - 3.16.0 + 4.0.0-RC2 4.4 2.0 3.3.0 @@ -42,6 +42,10 @@ org.yaml snakeyaml + + ch.qos.logback + logback-classic + diff --git a/service/solace-plugin/src/main/java/com/solace/maas/ep/event/management/agent/plugin/solace/processor/semp/SolaceHttpSemp.java b/service/solace-plugin/src/main/java/com/solace/maas/ep/event/management/agent/plugin/solace/processor/semp/SolaceHttpSemp.java index 6df4c0bb..4761e17d 100644 --- a/service/solace-plugin/src/main/java/com/solace/maas/ep/event/management/agent/plugin/solace/processor/semp/SolaceHttpSemp.java +++ b/service/solace-plugin/src/main/java/com/solace/maas/ep/event/management/agent/plugin/solace/processor/semp/SolaceHttpSemp.java @@ -28,6 +28,9 @@ import java.util.Optional; import java.util.function.Function; +import static org.springframework.http.HttpStatus.BAD_REQUEST; +import static org.springframework.http.HttpStatus.UNAUTHORIZED; + @ExcludeFromJacocoGeneratedReport @SuppressWarnings("CPD-START") @Slf4j @@ -95,18 +98,17 @@ private List> getResultsListMapFromSemp(String uriPath, try { getSempListRequest(sempObject, createUriBuilderFunction(uriPath, substitutionMap, selectFields)); } catch (WebClientResponseException ex) { - switch (ex.getStatusCode()) { - case BAD_REQUEST: - log.error("Error during SEMP Data Collection. Invalid path to data." + - " Check that the SEMP URL and protocol are correct.", ex); - throw new SempException(ex); - case UNAUTHORIZED: - log.error("Error during SEMP Data Collection. Could not authenticate with the server." + - "Check that the SEMP username and password are correct.", ex); - throw new SempException(ex); - default: - log.error("Error during SEMP Data Collection.", ex); - throw new SempException(ex); + if (ex.getStatusCode() == BAD_REQUEST) { + log.error("Error during SEMP Data Collection. Invalid path to data." + + " Check that the SEMP URL and protocol are correct.", ex); + throw new SempException(ex); + } else if (ex.getStatusCode() == UNAUTHORIZED) { + log.error("Error during SEMP Data Collection. Could not authenticate with the server." + + "Check that the SEMP username and password are correct.", ex); + throw new SempException(ex); + } else { + log.error("Error during SEMP Data Collection.", ex); + throw new SempException(ex); } } catch (IOException ioException) { log.error("Error during SEMP Data Collection. The format of the collected data is unexpected.", ioException); diff --git a/service/solace-plugin/src/test/java/com/solace/maas/ep/event/management/agent/plugin/solace/processor/SolaceSempClientTests.java b/service/solace-plugin/src/test/java/com/solace/maas/ep/event/management/agent/plugin/solace/processor/SolaceSempClientTests.java index 211f5c4b..c1c3eb03 100644 --- a/service/solace-plugin/src/test/java/com/solace/maas/ep/event/management/agent/plugin/solace/processor/SolaceSempClientTests.java +++ b/service/solace-plugin/src/test/java/com/solace/maas/ep/event/management/agent/plugin/solace/processor/SolaceSempClientTests.java @@ -2,8 +2,10 @@ import com.solace.maas.ep.event.management.agent.plugin.solace.SolaceTestConfig; import com.solace.maas.ep.event.management.agent.plugin.solace.processor.semp.SempClient; +import com.solace.maas.ep.event.management.agent.plugin.solace.processor.semp.SempException; import com.solace.maas.ep.event.management.agent.plugin.solace.processor.semp.SolaceHttpSemp; import lombok.SneakyThrows; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; @@ -11,9 +13,11 @@ import org.mockito.Mock; import org.mockito.stubbing.Answer; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.context.ActiveProfiles; import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClientResponseException; import org.springframework.web.util.DefaultUriBuilderFactory; import org.springframework.web.util.UriBuilder; import reactor.core.publisher.Mono; @@ -135,6 +139,46 @@ public void badConnectionUrlTest() throws IOException { assertEquals("Could not construct URI from worst url ever", exception.getMessage()); } + @Test + public void throwBadRequestExceptionWhileGettingQueues() { + WebClient mockWebClient = mock(WebClient.class); + + when(mockWebClient.get()).thenThrow(new WebClientResponseException(HttpStatus.BAD_REQUEST.value(), "bad", null, null, null)); + + SempClient mockSempClient = SempClient.builder() + .connectionUrl("http://myHost:12345") + .webClient(mockWebClient) + .username("myUsername") + .password("myPassword") + .msgVpn("xyz") + .build(); + SolaceHttpSemp semp = new SolaceHttpSemp(mockSempClient); + SempException ex = Assertions.assertThrows(SempException.class, () -> { + semp.getQueues(); + }); + assertEquals(400, ((WebClientResponseException) ex.getCause()).getStatusCode().value()); + } + + @Test + public void throwUnauthorizedExceptionWhileGettingQueues() { + WebClient mockWebClient = mock(WebClient.class); + + when(mockWebClient.get()).thenThrow(new WebClientResponseException(HttpStatus.UNAUTHORIZED.value(), "bad", null, null, null)); + + SempClient mockSempClient = SempClient.builder() + .connectionUrl("http://myHost:12345") + .webClient(mockWebClient) + .username("myUsername") + .password("myPassword") + .msgVpn("xyz") + .build(); + SolaceHttpSemp semp = new SolaceHttpSemp(mockSempClient); + SempException ex = Assertions.assertThrows(SempException.class, () -> { + semp.getQueues(); + }); + assertEquals(401, ((WebClientResponseException) ex.getCause()).getStatusCode().value()); + } + private void mockHttp(WebClient webClient) { WebClient.RequestHeadersUriSpec request = mock(WebClient.RequestHeadersUriSpec.class); when(webClient.get()).thenReturn(request);