diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2023-09-20 09:35:10 +0000 |
---|---|---|
committer | Toine Siebelink <toine.siebelink@est.tech> | 2023-09-20 12:48:19 +0000 |
commit | ad9b701a00c237ae8e462de76b500c8612866da6 (patch) | |
tree | 5f96ff03f2e4d5f3423c28bdffbfeb7c943cf924 | |
parent | bba4d73e53cc79263fc162c4907facf43f13bdbf (diff) |
Revert "Migrate CPS to Spring-boot 3.0"
This reverts commit 9693ec51cf6526082f0ad0c3ad208d144cbbb163.
Reason for revert: Bug fix delivery
Change-Id: I73bdc1528192c662983b0bbef73b10b6d612a719
Signed-off-by: egernug <gerard.nugent@est.tech>
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
53 files changed, 162 insertions, 309 deletions
diff --git a/cps-application/pom.xml b/cps-application/pom.xml index 15868b1596..e8869707ce 100755 --- a/cps-application/pom.xml +++ b/cps-application/pom.xml @@ -40,7 +40,6 @@ <minimum-coverage>0.86</minimum-coverage> <base.image>${docker.pull.registry}/onap/integration-java17:12.0.0</base.image> <image.tag>${project.version}-${maven.build.timestamp}</image.tag> - <jakarta-servlet.version>5.0.0</jakarta-servlet.version> </properties> <dependencies> @@ -71,8 +70,8 @@ <artifactId>micrometer-registry-prometheus</artifactId> </dependency> <dependency> - <groupId>io.micrometer</groupId> - <artifactId>micrometer-tracing-bridge-brave</artifactId> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-starter-sleuth</artifactId> </dependency> <!-- T E S T D E P E N D E N C I E S --> <dependency> @@ -119,14 +118,6 @@ <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-xml</artifactId> </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - </dependency> </dependencies> <build> diff --git a/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java b/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java index c8b2509637..aedc6a8d66 100644 --- a/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java +++ b/cps-application/src/main/java/org/onap/cps/config/WebSecurityConfig.java @@ -54,7 +54,7 @@ public class WebSecurityConfig { * @param password password */ public WebSecurityConfig( - @Autowired @Value("${permit-uri}") final String permitUris, + @Autowired @Value("${security.permit-uri}") final String permitUris, @Autowired @Value("${security.auth.username}") final String username, @Autowired @Value("${security.auth.password}") final String password ) { @@ -80,8 +80,8 @@ public class WebSecurityConfig { http .httpBasic() .and() - .authorizeHttpRequests() - .requestMatchers(permitUris).permitAll() + .authorizeRequests() + .antMatchers(permitUris).permitAll() .anyRequest().authenticated() .and() .csrf().disable(); diff --git a/cps-application/src/main/resources/application.yml b/cps-application/src/main/resources/application.yml index 016356801d..58748271cc 100644 --- a/cps-application/src/main/resources/application.yml +++ b/cps-application/src/main/resources/application.yml @@ -140,10 +140,10 @@ springdoc: - name: cps-ncmp-inventory url: /api-docs/cps-ncmp/openapi-inventory.yaml -permit-uri: /manage/**,/swagger-ui.html,/swagger-ui/**,/swagger-resources/**,/api-docs/** security: # comma-separated uri patterns which do not require authorization + permit-uri: /manage/**,/swagger-ui.html,/swagger-ui/**,/swagger-resources/**,/api-docs/** auth: username: ${CPS_USERNAME} password: ${CPS_PASSWORD} diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml index 55e7c07929..822d7cc82b 100755 --- a/cps-dependencies/pom.xml +++ b/cps-dependencies/pom.xml @@ -34,12 +34,12 @@ <description>This artifact contains dependencyManagement declarations of upstream versions.</description> <properties> - <groovy.version>3.0.18</groovy.version> + <groovy.version>3.0.9</groovy.version> <nexusproxy>https://nexus.onap.org</nexusproxy> <releaseNexusPath>/content/repositories/releases/</releaseNexusPath> <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath> <sonar.skip>true</sonar.skip> - <testcontainers.version>1.18.3</testcontainers.version> + <testcontainers.version>1.17.3</testcontainers.version> <mapstruct.version>1.4.2.Final</mapstruct.version> </properties> @@ -78,14 +78,14 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> - <version>3.0.0</version> + <version>2.7.6</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> - <version>2022.0.3</version> + <version>2021.0.3</version> <type>pom</type> <scope>import</scope> </dependency> @@ -113,8 +113,8 @@ </dependency> <dependency> <groupId>io.hypersistence</groupId> - <artifactId>hypersistence-utils-hibernate-60</artifactId> - <version>3.5.0</version> + <artifactId>hypersistence-utils-hibernate-52</artifactId> + <version>3.3.2</version> </dependency> <dependency> <groupId>org.antlr</groupId> @@ -134,12 +134,12 @@ <dependency> <groupId>org.spockframework</groupId> <artifactId>spock-core</artifactId> - <version>2.4-M1-groovy-3.0</version> + <version>2.0-M5-groovy-3.0</version> </dependency> <dependency> <groupId>org.spockframework</groupId> <artifactId>spock-spring</artifactId> - <version>2.4-M1-groovy-3.0</version> + <version>2.0-M5-groovy-3.0</version> </dependency> <dependency> <groupId>cglib</groupId> @@ -166,7 +166,7 @@ <dependency> <groupId>org.testcontainers</groupId> <artifactId>testcontainers-bom</artifactId> - <version>1.18.3</version> + <version>1.17.3</version> <type>pom</type> <scope>import</scope> </dependency> @@ -209,7 +209,7 @@ <dependency> <groupId>com.hazelcast</groupId> <artifactId>hazelcast-spring</artifactId> - <version>5.3.1</version> + <version>4.2.5</version> </dependency> <dependency> <groupId>com.google.guava</groupId> @@ -217,85 +217,15 @@ <version>31.1-jre</version> </dependency> <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-properties-migrator</artifactId> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>jakarta.validation</groupId> - <artifactId>jakarta.validation-api</artifactId> - <version>3.0.2</version> + <groupId>javax.validation</groupId> + <artifactId>validation-api</artifactId> + <version>2.0.1.Final</version> </dependency> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>3.3.1</version> </dependency> - <dependency> - <groupId>io.micrometer</groupId> - <artifactId>micrometer-tracing-bridge-brave</artifactId> - <version>1.0.0</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.dataformat</groupId> - <artifactId>jackson-dataformat-xml</artifactId> - <version>2.13.1</version> - </dependency> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-models</artifactId> - <version>2.2.15</version> - </dependency> - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - <version>1.18.24</version> - </dependency> - <dependency> - <groupId>io.gsonfire</groupId> - <artifactId>gson-fire</artifactId> - <version>1.8.5</version> - </dependency> - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>2.14.0</version> - </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>11.0.14</version> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>6.0.0</version> - </dependency> - <dependency> - <groupId>org.openapitools</groupId> - <artifactId>jackson-databind-nullable</artifactId> - <version>0.2.4</version> - </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-api</artifactId> - <version>5.10.0</version> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <version>6.0.11</version> - </dependency> - <dependency> - <groupId>org.spockframework</groupId> - <artifactId>spock-core</artifactId> - <version>2.4-M1-groovy-3.0</version> - </dependency> - <dependency> - <groupId>org.spockframework</groupId> - <artifactId>spock-spring</artifactId> - <version>2.4-M1-groovy-3.0</version> - </dependency> </dependencies> </dependencyManagement> </project> diff --git a/cps-ncmp-events/pom.xml b/cps-ncmp-events/pom.xml index f08142e3d3..47b10c959a 100644 --- a/cps-ncmp-events/pom.xml +++ b/cps-ncmp-events/pom.xml @@ -36,8 +36,8 @@ <artifactId>jackson-databind</artifactId> </dependency> <dependency> - <groupId>jakarta.validation</groupId> - <artifactId>jakarta.validation-api</artifactId> + <groupId>javax.validation</groupId> + <artifactId>validation-api</artifactId> </dependency> </dependencies> @@ -47,7 +47,6 @@ <groupId>org.jsonschema2pojo</groupId> <artifactId>jsonschema2pojo-maven-plugin</artifactId> <configuration> - <useJakartaValidation>true</useJakartaValidation> <sourceDirectory>${basedir}/src/main/resources/schemas</sourceDirectory> <targetPackage>org.onap.cps.ncmp.event.model</targetPackage> <generateBuilders>true</generateBuilders> diff --git a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java index 198b14fc35..bf84b439f5 100644 --- a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java +++ b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java @@ -22,8 +22,6 @@ package org.onap.cps.ncmp.rest.stub.controller; import com.fasterxml.jackson.databind.ObjectMapper; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; @@ -34,6 +32,8 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.UUID; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.api.impl.operations.DatastoreType; import org.onap.cps.ncmp.rest.api.NetworkCmProxyApi; diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml index be5164375c..243de62102 100644 --- a/cps-ncmp-rest/docs/openapi/components.yaml +++ b/cps-ncmp-rest/docs/openapi/components.yaml @@ -223,12 +223,12 @@ components: state: $ref: '#/components/schemas/CmHandleCompositeState' CmHandlePublicProperties: - type: object + type: array items: - type: object - additionalProperties: - type: string - example: 'Book Type' + type: object + additionalProperties: + type: string + example: Book Type CmHandleCompositeState: type: object properties: diff --git a/cps-ncmp-rest/pom.xml b/cps-ncmp-rest/pom.xml index edb7ff5e8c..1ac1bd7e6e 100644 --- a/cps-ncmp-rest/pom.xml +++ b/cps-ncmp-rest/pom.xml @@ -33,10 +33,6 @@ <artifactId>cps-ncmp-rest</artifactId> - <properties> - <minimum-coverage>0.99</minimum-coverage> - </properties> - <dependencies> <dependency> <groupId>${project.groupId}</groupId> @@ -66,10 +62,6 @@ <artifactId>swagger-annotations</artifactId> </dependency> <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-models</artifactId> - </dependency> - <dependency> <groupId>org.mapstruct</groupId> <artifactId>mapstruct</artifactId> </dependency> @@ -106,6 +98,7 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> @@ -117,14 +110,6 @@ <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> </dependency> - <dependency> - <groupId>org.openapitools</groupId> - <artifactId>jackson-databind-nullable</artifactId> - </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-api</artifactId> - </dependency> </dependencies> <build> @@ -152,7 +137,6 @@ <sourceFolder>src/gen/java</sourceFolder> <dateLibrary>java11</dateLibrary> <interfaceOnly>true</interfaceOnly> - <useSpringBoot3>true</useSpringBoot3> <useTags>true</useTags> <openApiNullable>false</openApiNullable> <skipDefaultInterface>true</skipDefaultInterface> @@ -175,7 +159,6 @@ <sourceFolder>src/gen/java</sourceFolder> <dateLibrary>java11</dateLibrary> <interfaceOnly>true</interfaceOnly> - <useSpringBoot3>true</useSpringBoot3> <useTags>true</useTags> <openApiNullable>false</openApiNullable> <skipDefaultInterface>true</skipDefaultInterface> @@ -190,10 +173,9 @@ <phase>compile</phase> <configuration> <inputSpec>${project.basedir}/docs/openapi/openapi-inventory.yml</inputSpec> - <generatorName>spring</generatorName> + <generatorName>openapi-yaml</generatorName> <configOptions> <outputFile>openapi-inventory.yaml</outputFile> - <useSpringBoot3>true</useSpringBoot3> </configOptions> </configuration> </execution> diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java index 87f9d835a1..5d8599a1a2 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java @@ -22,10 +22,10 @@ package org.onap.cps.ncmp.rest.controller; import io.micrometer.core.annotation.Timed; -import jakarta.validation.Valid; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; +import javax.validation.Valid; import lombok.RequiredArgsConstructor; import org.onap.cps.ncmp.api.NetworkCmProxyDataService; import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters; diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandlerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandlerSpec.groovy index 2885ed2325..b11787aa6d 100644 --- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandlerSpec.groovy +++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/handlers/NcmpDatastoreRequestHandlerSpec.groovy @@ -44,7 +44,7 @@ class NcmpDatastoreRequestHandlerSpec extends Specification { objectUnderTest.executeRequest('ds', 'ch1', 'resource1', 'options', topic, false) and: 'wait a little for async execution (only if expected)' if (expectedCalls > 0) { - Thread.sleep(500) + Thread.sleep(100) } then: 'the task is executed in an async fashion or not' expectedCalls * spiedCpsNcmpTaskExecutor.executeTask(*_) diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy index b1133a1899..9a09b97973 100644 --- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy +++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy @@ -26,7 +26,6 @@ import org.onap.cps.ncmp.api.inventory.CompositeStateBuilder import org.onap.cps.ncmp.api.inventory.LockReasonCategory import org.onap.cps.ncmp.rest.model.CmHandleCompositeState import org.onap.cps.ncmp.api.inventory.DataStoreSyncState -import spock.lang.Ignore import spock.lang.Specification import java.time.OffsetDateTime @@ -60,7 +59,6 @@ class CmHandleStateMapperSpec extends Specification { assert result.dataSyncState.operational.getSyncState() != null } - @Ignore def 'Handling null state.'() { expect: 'converting null returns null' objectUnderTest.toDataStores(null) == null diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/client/DmiRestClient.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/client/DmiRestClient.java index 6a8310c207..7066f80165 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/client/DmiRestClient.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/client/DmiRestClient.java @@ -60,7 +60,7 @@ public class DmiRestClient { } catch (final HttpStatusCodeException httpStatusCodeException) { final String exceptionMessage = "Unable to " + operationType.toString() + " resource data."; throw new HttpClientRequestException(exceptionMessage, httpStatusCodeException.getResponseBodyAsString(), - httpStatusCodeException.getStatusCode().value()); + httpStatusCodeException.getRawStatusCode()); } } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/EventsPublisher.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/EventsPublisher.java index 58d0d2d48f..4c90648521 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/EventsPublisher.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/EventsPublisher.java @@ -22,7 +22,6 @@ package org.onap.cps.ncmp.api.impl.events; import io.cloudevents.CloudEvent; import java.util.Map; -import java.util.concurrent.CompletableFuture; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.producer.ProducerRecord; @@ -32,6 +31,8 @@ import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.support.SendResult; import org.springframework.stereotype.Service; import org.springframework.util.SerializationUtils; +import org.springframework.util.concurrent.ListenableFuture; +import org.springframework.util.concurrent.ListenableFutureCallback; /** * EventsPublisher to publish events. @@ -60,17 +61,9 @@ public class EventsPublisher<T> { * @param event message payload */ public void publishCloudEvent(final String topicName, final String eventKey, final CloudEvent event) { - final CompletableFuture<SendResult<String, CloudEvent>> eventFuture = - cloudEventKafkaTemplate.send(topicName, eventKey, event); - eventFuture.whenComplete((result, e) -> { - if (e == null) { - log.debug("Successfully published event to topic : {} , Event : {}", - result.getRecordMetadata().topic(), result.getProducerRecord().value()); - - } else { - log.error("Unable to publish event to topic : {} due to {}", topicName, e.getMessage()); - } - }); + final ListenableFuture<SendResult<String, CloudEvent>> eventFuture + = cloudEventKafkaTemplate.send(topicName, eventKey, event); + eventFuture.addCallback(handleCallback(topicName)); } /** @@ -83,16 +76,9 @@ public class EventsPublisher<T> { */ @Deprecated(forRemoval = true) public void publishEvent(final String topicName, final String eventKey, final T event) { - final CompletableFuture<SendResult<String, T>> eventFuture = - legacyKafkaEventTemplate.send(topicName, eventKey, event); - eventFuture.whenComplete((result, e) -> { - if (e == null) { - log.debug("Successfully published event to topic : {} , Event : {}", - result.getRecordMetadata().topic(), result.getProducerRecord().value()); - } else { - log.error("Unable to publish event to topic : {} due to {}", topicName, e.getMessage()); - } - }); + final ListenableFuture<SendResult<String, T>> eventFuture + = legacyKafkaEventTemplate.send(topicName, eventKey, event); + eventFuture.addCallback(handleCallback(topicName)); } /** @@ -107,16 +93,8 @@ public class EventsPublisher<T> { final ProducerRecord<String, T> producerRecord = new ProducerRecord<>(topicName, null, eventKey, event, eventHeaders); - final CompletableFuture<SendResult<String, T>> eventFuture = - legacyKafkaEventTemplate.send(producerRecord); - eventFuture.whenComplete((result, ex) -> { - if (ex != null) { - log.error("Unable to publish event to topic : {} due to {}", topicName, ex.getMessage()); - } else { - log.debug("Successfully published event to topic : {} , Event : {}", - result.getRecordMetadata().topic(), result.getProducerRecord().value()); - } - }); + final ListenableFuture<SendResult<String, T>> eventFuture = legacyKafkaEventTemplate.send(producerRecord); + eventFuture.addCallback(handleCallback(topicName)); } /** @@ -133,6 +111,20 @@ public class EventsPublisher<T> { publishEvent(topicName, eventKey, convertToKafkaHeaders(eventHeaders), event); } + private ListenableFutureCallback<SendResult<String, ?>> handleCallback(final String topicName) { + return new ListenableFutureCallback<>() { + @Override + public void onFailure(final Throwable throwable) { + log.error("Unable to publish event to topic : {} due to {}", topicName, throwable.getMessage()); + } + + @Override + public void onSuccess(final SendResult<String, ?> sendResult) { + log.debug("Successfully published event to topic : {} , Event : {}", + sendResult.getRecordMetadata().topic(), sendResult.getProducerRecord().value()); + } + }; + } private Headers convertToKafkaHeaders(final Map<String, Object> eventMessageHeaders) { final Headers eventHeaders = new RecordHeaders(); diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/executor/AsyncTaskExecutor.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/executor/AsyncTaskExecutor.java index 3d08185e14..cac78af050 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/executor/AsyncTaskExecutor.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/executor/AsyncTaskExecutor.java @@ -22,12 +22,12 @@ package org.onap.cps.ncmp.api.inventory.sync.executor; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import jakarta.annotation.PostConstruct; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeoutException; import java.util.function.Supplier; +import javax.annotation.PostConstruct; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandleQueryApiParameters.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandleQueryApiParameters.java index dd8dcd60ac..bf6600d97e 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandleQueryApiParameters.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandleQueryApiParameters.java @@ -24,9 +24,9 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.Valid; import java.util.Collections; import java.util.List; +import javax.validation.Valid; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandleQueryServiceParameters.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandleQueryServiceParameters.java index 5eeafaca33..774f04b5a4 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandleQueryServiceParameters.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandleQueryServiceParameters.java @@ -23,9 +23,9 @@ package org.onap.cps.ncmp.api.models; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.Valid; import java.util.Collections; import java.util.List; +import javax.validation.Valid; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmSubscriptionEvent.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmSubscriptionEvent.java index c20696a8b6..2a60b2ab16 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmSubscriptionEvent.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmSubscriptionEvent.java @@ -22,10 +22,10 @@ package org.onap.cps.ncmp.api.models; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmSubscriptionStatus.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmSubscriptionStatus.java index 5541a01bd8..bba560785d 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmSubscriptionStatus.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmSubscriptionStatus.java @@ -22,7 +22,7 @@ package org.onap.cps.ncmp.api.models; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.constraints.NotNull; +import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; import org.onap.cps.ncmp.api.impl.subscriptions.SubscriptionStatus; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/ConditionApiProperties.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/ConditionApiProperties.java index 5cb2ed376c..9f6d64e164 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/ConditionApiProperties.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/ConditionApiProperties.java @@ -22,10 +22,10 @@ package org.onap.cps.ncmp.api.models; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.Valid; import java.util.Collections; import java.util.List; import java.util.Map; +import javax.validation.Valid; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationDefinition.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationDefinition.java index 366d845832..8182fbfcc8 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationDefinition.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationDefinition.java @@ -23,9 +23,9 @@ package org.onap.cps.ncmp.api.models; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.Valid; import java.util.ArrayList; import java.util.List; +import javax.validation.Valid; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationRequest.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationRequest.java index a4d070c38d..6fa7d5c755 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationRequest.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationRequest.java @@ -23,9 +23,9 @@ package org.onap.cps.ncmp.api.models; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.Valid; import java.util.Collections; import java.util.List; +import javax.validation.Valid; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/EventPublisherSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/EventPublisherSpec.groovy index d0f1afd5d5..59a43caf9e 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/EventPublisherSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/EventPublisherSpec.groovy @@ -29,7 +29,6 @@ import org.apache.kafka.common.TopicPartition import org.onap.cps.ncmp.init.SubscriptionModelLoader import org.slf4j.LoggerFactory import org.springframework.kafka.support.SendResult -import spock.lang.Ignore import spock.lang.Specification class EventPublisherSpec extends Specification { @@ -49,7 +48,6 @@ class EventPublisherSpec extends Specification { ((Logger) LoggerFactory.getLogger(SubscriptionModelLoader.class)).detachAndStopAllAppenders() } - @Ignore def 'Callback handling on success.'() { given: 'a send result' def producerRecord = new ProducerRecord('topic-1', 'my value') @@ -68,7 +66,6 @@ class EventPublisherSpec extends Specification { } - @Ignore def 'Callback handling on failure.'() { when: 'the callback handler processes a failure' def callbackHandler = objectUnderTest.handleCallback('my topic') diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/kafka/ConsumerBaseSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/kafka/ConsumerBaseSpec.groovy index 28f8b02880..940c59d57f 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/kafka/ConsumerBaseSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/kafka/ConsumerBaseSpec.groovy @@ -25,7 +25,7 @@ import org.springframework.boot.test.context.SpringBootTest import org.springframework.kafka.config.KafkaListenerEndpointRegistry import org.springframework.kafka.test.utils.ContainerTestUtils -@SpringBootTest(classes = KafkaListenerEndpointRegistry.class) +@SpringBootTest class ConsumerBaseSpec extends MessagingBaseSpec { @Autowired diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml index efee388fe9..a8de0ae0eb 100755 --- a/cps-parent/pom.xml +++ b/cps-parent/pom.xml @@ -46,7 +46,6 @@ ../jacoco-report/target/site/jacoco-aggregate/jacoco.xml </sonar.coverage.jacoco.xmlReportPaths> <parent.directory>${project.basedir}/..</parent.directory> - <maven.compiler.release>17</maven.compiler.release> </properties> <profiles> @@ -118,7 +117,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>3.0.0</version> + <version>2.6.4</version> <executions> <execution> <goals> @@ -170,7 +169,7 @@ <!-- The SpotBugs Maven plugin uses SLF4J 1.8 beta 2 --> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> - <version>2.0.6</version> + <version>1.8.0-beta4</version> </dependency> </dependencies> <configuration> @@ -215,7 +214,7 @@ <plugin> <groupId>org.jsonschema2pojo</groupId> <artifactId>jsonschema2pojo-maven-plugin</artifactId> - <version>1.2.1</version> + <version>1.1.1</version> <configuration> <targetVersion>${java.version}</targetVersion> </configuration> @@ -233,7 +232,10 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>3.11.0</version> + <configuration> + <source>${java.version}</source> + <target>${java.version}</target> + </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/cps-rest/pom.xml b/cps-rest/pom.xml index 5330b8633f..8d92d972c7 100755 --- a/cps-rest/pom.xml +++ b/cps-rest/pom.xml @@ -122,14 +122,6 @@ </exclusion> </exclusions> </dependency> - <dependency> - <groupId>jakarta.validation</groupId> - <artifactId>jakarta.validation-api</artifactId> - </dependency> - <dependency> - <groupId>io.gsonfire</groupId> - <artifactId>gson-fire</artifactId> - </dependency> </dependencies> <build> @@ -156,7 +148,6 @@ <sourceFolder>src/gen/java</sourceFolder> <dateLibrary>java11</dateLibrary> <interfaceOnly>true</interfaceOnly> - <useSpringBoot3>true</useSpringBoot3> <useTags>true</useTags> <openApiNullable>false</openApiNullable> <skipDefaultInterface>true</skipDefaultInterface> diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java index 993dad58c3..369c94d294 100755 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java @@ -27,11 +27,11 @@ import static org.onap.cps.rest.utils.MultipartFileUtil.extractYangResourcesMap; import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_PROHIBITED; import io.micrometer.core.annotation.Timed; -import jakarta.validation.Valid; -import jakarta.validation.constraints.NotNull; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; import org.onap.cps.api.CpsAdminService; import org.onap.cps.api.CpsModuleService; diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java index 60e7fb6d2d..62163327ff 100755 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java @@ -25,13 +25,13 @@ package org.onap.cps.rest.controller; import io.micrometer.core.annotation.Timed; -import jakarta.validation.ValidationException; import java.time.OffsetDateTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; +import javax.validation.ValidationException; import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.onap.cps.api.CpsDataService; diff --git a/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java b/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java index 1f6cf1724c..5dfd03bf2b 100755 --- a/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/exceptions/CpsRestExceptionHandler.java @@ -22,8 +22,8 @@ package org.onap.cps.rest.exceptions; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.validation.ValidationException; +import javax.servlet.http.HttpServletRequest; +import javax.validation.ValidationException; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/cps-ri/pom.xml b/cps-ri/pom.xml index 0a32a3a0b7..1a1c4a0489 100644 --- a/cps-ri/pom.xml +++ b/cps-ri/pom.xml @@ -71,7 +71,7 @@ <!-- Add Hibernate support for Postgres datatype JSONB and Postgres arrays -->
<dependency>
<groupId>io.hypersistence</groupId>
- <artifactId>hypersistence-utils-hibernate-60</artifactId>
+ <artifactId>hypersistence-utils-hibernate-52</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/AnchorEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/AnchorEntity.java index f0927ca103..403741a2d6 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/entities/AnchorEntity.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/AnchorEntity.java @@ -20,17 +20,17 @@ package org.onap.cps.spi.entities; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.Table; -import jakarta.validation.constraints.NotNull; import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.EqualsAndHashCode; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/DataspaceEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/DataspaceEntity.java index ddfb09c942..4d97054d9e 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/entities/DataspaceEntity.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/DataspaceEntity.java @@ -21,14 +21,14 @@ package org.onap.cps.spi.entities; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.Table; -import jakarta.validation.constraints.NotNull; import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java index 12f42f2b7e..f2cfe6322f 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/FragmentEntity.java @@ -21,20 +21,21 @@ package org.onap.cps.spi.entities; -import jakarta.persistence.CascadeType; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.OneToMany; -import jakarta.persistence.Table; -import jakarta.validation.constraints.NotNull; +import io.hypersistence.utils.hibernate.type.json.JsonBinaryType; import java.io.Serializable; import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -43,8 +44,8 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; -import org.hibernate.annotations.JdbcTypeCode; -import org.hibernate.type.SqlTypes; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; /** * Entity to store a fragment. @@ -57,6 +58,7 @@ import org.hibernate.type.SqlTypes; @Builder @Entity @Table(name = "fragment") +@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class) @EqualsAndHashCode(onlyExplicitlyIncluded = true) public class FragmentEntity implements Serializable { @@ -74,7 +76,7 @@ public class FragmentEntity implements Serializable { @Column(name = "parent_id") private Long parentId; - @JdbcTypeCode(SqlTypes.JSON) + @Type(type = "jsonb") @Column(columnDefinition = "jsonb") private String attributes; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/SchemaSetEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/SchemaSetEntity.java index e07f766ed0..9926dfad1a 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/entities/SchemaSetEntity.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/SchemaSetEntity.java @@ -19,20 +19,20 @@ package org.onap.cps.spi.entities; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.JoinColumn; -import jakarta.persistence.JoinTable; -import jakarta.persistence.ManyToMany; -import jakarta.persistence.ManyToOne; -import jakarta.persistence.Table; -import jakarta.validation.constraints.NotNull; import java.io.Serializable; import java.util.Set; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/entities/YangResourceEntity.java b/cps-ri/src/main/java/org/onap/cps/spi/entities/YangResourceEntity.java index 0c54baa4df..71d97a3ed2 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/entities/YangResourceEntity.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/entities/YangResourceEntity.java @@ -20,16 +20,16 @@ package org.onap.cps.spi.entities; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.ManyToMany; -import jakarta.persistence.Table; -import jakarta.validation.constraints.NotNull; import java.io.Serializable; import java.util.Set; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java index 2fb08d2c63..847a4a32fe 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsAdminPersistenceServiceImpl.java @@ -23,11 +23,11 @@ package org.onap.cps.spi.impl; -import jakarta.transaction.Transactional; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; +import javax.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.spi.CpsAdminPersistenceService; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java index 50e671d247..c3b8adb5dd 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java @@ -28,7 +28,6 @@ import static org.onap.cps.spi.PaginationOption.NO_PAGINATION; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet.Builder; import io.micrometer.core.annotation.Timed; -import jakarta.transaction.Transactional; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; @@ -41,6 +40,7 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import javax.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.hibernate.StaleStateException; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java index ca88a4da22..9d0b7ee0d6 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java @@ -27,7 +27,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableSet; -import jakarta.transaction.Transactional; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -41,6 +40,7 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import javax.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.digest.DigestUtils; @@ -134,7 +134,7 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ @Transactional // A retry is made to store the schema set if it fails because of duplicated yang resource exception that // can occur in case of specific concurrent requests. - @Retryable(retryFor = DuplicatedYangResourceException.class, maxAttempts = 5, backoff = + @Retryable(value = DuplicatedYangResourceException.class, maxAttempts = 5, backoff = @Backoff(random = true, delay = 200, maxDelay = 2000, multiplier = 2)) public void storeSchemaSet(final String dataspaceName, final String schemaSetName, final Map<String, String> moduleReferenceNameToContentMap) { @@ -163,7 +163,7 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ @Transactional // A retry is made to store the schema set if it fails because of duplicated yang resource exception that // can occur in case of specific concurrent requests. - @Retryable(retryFor = DuplicatedYangResourceException.class, maxAttempts = 5, backoff = + @Retryable(value = DuplicatedYangResourceException.class, maxAttempts = 5, backoff = @Backoff(random = true, delay = 200, maxDelay = 2000, multiplier = 2)) public void storeSchemaSetFromModules(final String dataspaceName, final String schemaSetName, final Map<String, String> newModuleNameToContentMap, diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java index e62471b005..472ed409aa 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java @@ -21,15 +21,15 @@ package org.onap.cps.spi.repository; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.Query; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Queue; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.cpspath.parser.CpsPathPrefixType; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java index 1a31d2b499..e38fc2f47e 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java @@ -124,15 +124,7 @@ public interface FragmentRepository extends JpaRepository<FragmentEntity, Long>, return findAllXpathByAnchorIdAndXpathIn(anchorEntity.getId(), xpaths.toArray(new String[0]));
}
- @Query(value = "SELECT EXISTS(SELECT 1 FROM fragment WHERE anchor_id = :anchorId"
- + " AND xpath LIKE :xpathPattern LIMIT 1)", nativeQuery = true)
- boolean existsByAnchorIdAndParentXpathAndXpathLike(@Param("anchorId") long anchorId,
- @Param("xpathPattern") String xpathPattern);
-
- default boolean existsByAnchorAndXpathStartsWith(final AnchorEntity anchorEntity, final String xpath) {
- return existsByAnchorIdAndParentXpathAndXpathLike(anchorEntity.getId(),
- EscapeUtils.escapeForSqlLike(xpath) + "%");
- }
+ boolean existsByAnchorAndXpathStartsWith(AnchorEntity anchorEntity, String xpath);
@Query(value = "SELECT * FROM fragment WHERE anchor_id = :anchorId AND parent_id IS NULL", nativeQuery = true)
List<FragmentEntity> findRootsByAnchorId(@Param("anchorId") long anchorId);
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepositoryCpsPathQueryImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepositoryCpsPathQueryImpl.java index 78e0f08c44..1ba9d1a4c5 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepositoryCpsPathQueryImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepositoryCpsPathQueryImpl.java @@ -21,11 +21,11 @@ package org.onap.cps.spi.repository; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.Query; -import jakarta.transaction.Transactional; import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; +import javax.transaction.Transactional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.cpspath.parser.CpsPathQuery; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java index 454848b98f..48982d51ff 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/ModuleReferenceRepositoryImpl.java @@ -20,13 +20,13 @@ package org.onap.cps.spi.repository; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/SchemaSetYangResourceRepositoryImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/SchemaSetYangResourceRepositoryImpl.java index c786a62d0c..0f7f2c0658 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/SchemaSetYangResourceRepositoryImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/SchemaSetYangResourceRepositoryImpl.java @@ -20,10 +20,10 @@ package org.onap.cps.spi.repository; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; import java.sql.PreparedStatement; import java.util.List; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; import org.hibernate.Session; import org.springframework.transaction.annotation.Transactional; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/TempTableCreator.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/TempTableCreator.java index 5804b2dc5d..4c7971ead8 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/TempTableCreator.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/TempTableCreator.java @@ -20,8 +20,6 @@ package org.onap.cps.spi.repository; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; @@ -29,6 +27,8 @@ import java.util.Iterator; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.spi.utils.EscapeUtils; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/YangResourceNativeRepositoryImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/YangResourceNativeRepositoryImpl.java index c84ff427e6..f09a1a0c46 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/YangResourceNativeRepositoryImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/YangResourceNativeRepositoryImpl.java @@ -20,13 +20,13 @@ package org.onap.cps.spi.repository; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; -import jakarta.persistence.Query; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.StringJoiner; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.Query; import lombok.extern.slf4j.Slf4j; import org.hibernate.type.StandardBasicTypes; import org.onap.cps.spi.model.ModuleReference; diff --git a/cps-ri/src/main/java/org/onap/cps/spi/utils/SessionManager.java b/cps-ri/src/main/java/org/onap/cps/spi/utils/SessionManager.java index 6150bf9dbe..eb3c5289af 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/utils/SessionManager.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/utils/SessionManager.java @@ -22,7 +22,6 @@ package org.onap.cps.spi.utils; import com.google.common.util.concurrent.TimeLimiter; import com.google.common.util.concurrent.UncheckedExecutionException; -import jakarta.annotation.PostConstruct; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; @@ -30,6 +29,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import javax.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; diff --git a/cps-service/pom.xml b/cps-service/pom.xml index 3f5d639896..d4fe2e31aa 100644 --- a/cps-service/pom.xml +++ b/cps-service/pom.xml @@ -111,7 +111,6 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> - <version>3.0.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> @@ -125,12 +124,6 @@ <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> - <scope>test</scope> - </dependency> - <!-- T E S T D E P E N D E N C I E S --> <dependency> <groupId>org.codehaus.groovy</groupId> @@ -177,9 +170,5 @@ <artifactId>aspectjrt</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>jakarta.validation</groupId> - <artifactId>jakarta.validation-api</artifactId> - </dependency> </dependencies> </project> diff --git a/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java b/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java index e0f8c97104..9327c53451 100644 --- a/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java +++ b/cps-service/src/main/java/org/onap/cps/config/AsyncConfig.java @@ -21,8 +21,8 @@ package org.onap.cps.config; -import jakarta.validation.constraints.Min; import java.util.concurrent.ThreadPoolExecutor; +import javax.validation.constraints.Min; import lombok.Setter; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/cps-service/src/main/java/org/onap/cps/notification/NotificationProperties.java b/cps-service/src/main/java/org/onap/cps/notification/NotificationProperties.java index b8a7144b3d..3776a93d94 100644 --- a/cps-service/src/main/java/org/onap/cps/notification/NotificationProperties.java +++ b/cps-service/src/main/java/org/onap/cps/notification/NotificationProperties.java @@ -19,9 +19,9 @@ package org.onap.cps.notification; -import jakarta.validation.constraints.NotNull; import java.util.Collections; import java.util.Map; +import javax.validation.constraints.NotNull; import lombok.Data; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/cps-service/src/main/java/org/onap/cps/notification/NotificationService.java b/cps-service/src/main/java/org/onap/cps/notification/NotificationService.java index c29d042293..b9d40740e0 100644 --- a/cps-service/src/main/java/org/onap/cps/notification/NotificationService.java +++ b/cps-service/src/main/java/org/onap/cps/notification/NotificationService.java @@ -21,7 +21,6 @@ package org.onap.cps.notification; -import jakarta.annotation.PostConstruct; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.Collections; @@ -30,6 +29,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Future; import java.util.regex.Pattern; import java.util.stream.Collectors; +import javax.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.api.CpsAdminService; diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/ConditionProperties.java b/cps-service/src/main/java/org/onap/cps/spi/model/ConditionProperties.java index 5f5e4bc4ae..4eee7db136 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/model/ConditionProperties.java +++ b/cps-service/src/main/java/org/onap/cps/spi/model/ConditionProperties.java @@ -22,10 +22,10 @@ package org.onap.cps.spi.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import jakarta.validation.Valid; import java.util.Collections; import java.util.List; import java.util.Map; +import javax.validation.Valid; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; diff --git a/csit/tests/cps-data-operations/cps-data-operations.robot b/csit/tests/cps-data-operations/cps-data-operations.robot index c3ec937d8d..16eb5f239e 100644 --- a/csit/tests/cps-data-operations/cps-data-operations.robot +++ b/csit/tests/cps-data-operations/cps-data-operations.robot @@ -60,9 +60,9 @@ Consume cloud event from client topic ${headers} Set Variable ${event.headers()} FOR ${header_key_value_pair} IN @{headers} Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_specversion" "1.0" + Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_source" "DMI" Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_type" "org.onap.cps.ncmp.events.async1_0_0.DataOperationEvent" Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_correlationid" "${expectedRequestId}" - Compare Header Values ${header_key_value_pair[0]} ${header_key_value_pair[1]} "ce_source" "DMI" END [Teardown] Basic Teardown ${group_id} diff --git a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-app/pom.xml b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-app/pom.xml index afc7f0736e..2d3a9be7e4 100644 --- a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-app/pom.xml +++ b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-app/pom.xml @@ -91,7 +91,6 @@ <plugin> <groupId>com.google.cloud.tools</groupId> <artifactId>jib-maven-plugin</artifactId> - <version>3.3.2</version> </plugin> </plugins> </build> @@ -103,15 +102,5 @@ <artifactId>dmi-plugin-demo-and-csit-stub-service</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-server</artifactId> - <version>11.0.14</version> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>6.0.0</version> - </dependency> </dependencies> </project>
\ No newline at end of file diff --git a/spotbugs/src/main/resources/spotbugs-exclude.xml b/spotbugs/src/main/resources/spotbugs-exclude.xml index 78f61d290e..ab37f41bae 100644 --- a/spotbugs/src/main/resources/spotbugs-exclude.xml +++ b/spotbugs/src/main/resources/spotbugs-exclude.xml @@ -49,7 +49,6 @@ <!-- https://github.com/spotbugs/spotbugs/issues/756. spotbugs does not grok Java 11's try-with-resources --> <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/> - <Bug pattern="UPM_UNCALLED_PRIVATE_METHOD"/> <Bug pattern="EI_EXPOSE_REP"/> <Bug pattern="EI_EXPOSE_REP2"/> </Or> |