summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Banka <michal.banka@nokia.com>2021-02-12 09:36:30 +0100
committerMichal Banka <michal.banka@nokia.com>2021-02-12 09:36:53 +0100
commitc5c005a74157d8436bffd714c316ce257d2700ca (patch)
treee4e57db9ba8d8d3bf4aca7f5d7acb7978ff17a15
parent7f7704977116ead5bc3ae8cba4afdf698d08bce7 (diff)
Remove Sonar code smells
- Reorganized test classes to match source code structure - Removed Sonar code smells - Removed unused test dependency from pom.xml Change-Id: If8fda0caf01fe9d91aa7c784a3875a856d87f63d Signed-off-by: Michal Banka <michal.banka@nokia.com> Issue-ID: DCAEGEN2-2575
-rw-r--r--pom.xml7
-rw-r--r--src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java2
-rw-r--r--src/test/java/org/onap/ves/openapi/manager/config/ValidatorPropertiesTest.java2
-rw-r--r--src/test/java/org/onap/ves/openapi/manager/model/DistributionStatusMessageTest.java2
-rw-r--r--src/test/java/org/onap/ves/openapi/manager/service/ArtifactsCollectorTest.java (renamed from src/test/java/org/onap/ves/openapi/manager/service/notification/ArtifactsCollectorTest.java)2
-rw-r--r--src/test/java/org/onap/ves/openapi/manager/service/ClientCallbackTest.java (renamed from src/test/java/org/onap/ves/openapi/manager/service/notification/ClientCallbackTest.java)13
6 files changed, 11 insertions, 17 deletions
diff --git a/pom.xml b/pom.xml
index 93140cd..6f26677 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,7 +40,6 @@
<docker-image.name.prefix>org.onap.dcaegen2.platform</docker-image.name.prefix>
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
- <bean-matchers.version>0.13</bean-matchers.version>
</properties>
<build>
@@ -207,12 +206,6 @@
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.google.code.bean-matchers</groupId>
- <artifactId>bean-matchers</artifactId>
- <version>${bean-matchers.version}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<distributionManagement>
diff --git a/src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java b/src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java
index 9118f82..bb2a2e5 100644
--- a/src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java
+++ b/src/test/java/org/onap/ves/openapi/manager/config/DistributionClientConfigTest.java
@@ -33,7 +33,7 @@ import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
-public class DistributionClientConfigTest {
+class DistributionClientConfigTest {
@Test
void shouldCreateDistributionClientConfig() {
diff --git a/src/test/java/org/onap/ves/openapi/manager/config/ValidatorPropertiesTest.java b/src/test/java/org/onap/ves/openapi/manager/config/ValidatorPropertiesTest.java
index 57b3725..f73dfc9 100644
--- a/src/test/java/org/onap/ves/openapi/manager/config/ValidatorPropertiesTest.java
+++ b/src/test/java/org/onap/ves/openapi/manager/config/ValidatorPropertiesTest.java
@@ -30,7 +30,7 @@ import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
-public class ValidatorPropertiesTest {
+class ValidatorPropertiesTest {
@Test
void shouldCreateDistributionClientConfig() {
diff --git a/src/test/java/org/onap/ves/openapi/manager/model/DistributionStatusMessageTest.java b/src/test/java/org/onap/ves/openapi/manager/model/DistributionStatusMessageTest.java
index e84b919..4adbdc7 100644
--- a/src/test/java/org/onap/ves/openapi/manager/model/DistributionStatusMessageTest.java
+++ b/src/test/java/org/onap/ves/openapi/manager/model/DistributionStatusMessageTest.java
@@ -29,7 +29,7 @@ import java.time.ZoneOffset;
import static org.assertj.core.api.Assertions.assertThat;
-public class DistributionStatusMessageTest {
+class DistributionStatusMessageTest {
@Test
void shouldCreateDistributionStatusMessage() {
//given
diff --git a/src/test/java/org/onap/ves/openapi/manager/service/notification/ArtifactsCollectorTest.java b/src/test/java/org/onap/ves/openapi/manager/service/ArtifactsCollectorTest.java
index 3da47f7..3955f9a 100644
--- a/src/test/java/org/onap/ves/openapi/manager/service/notification/ArtifactsCollectorTest.java
+++ b/src/test/java/org/onap/ves/openapi/manager/service/ArtifactsCollectorTest.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.ves.openapi.manager.service.notification;
+package org.onap.ves.openapi.manager.service;
import org.junit.jupiter.api.Test;
import org.onap.sdc.api.notification.IArtifactInfo;
diff --git a/src/test/java/org/onap/ves/openapi/manager/service/notification/ClientCallbackTest.java b/src/test/java/org/onap/ves/openapi/manager/service/ClientCallbackTest.java
index 91dfda7..8b0d275 100644
--- a/src/test/java/org/onap/ves/openapi/manager/service/notification/ClientCallbackTest.java
+++ b/src/test/java/org/onap/ves/openapi/manager/service/ClientCallbackTest.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.ves.openapi.manager.service.notification;
+package org.onap.ves.openapi.manager.service;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -28,8 +28,9 @@ import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.api.notification.INotificationData;
import org.onap.ves.openapi.manager.model.Artifact;
import org.onap.ves.openapi.manager.model.ArtifactValidationResult;
-import org.onap.ves.openapi.manager.service.ArtifactsCollector;
-import org.onap.ves.openapi.manager.service.ClientCallback;
+import org.onap.ves.openapi.manager.service.notification.ArtifactsCollectorStatusSender;
+import org.onap.ves.openapi.manager.service.notification.FinalStatusSender;
+import org.onap.ves.openapi.manager.service.notification.ValidationStatusSender;
import org.onap.ves.openapi.manager.service.testModel.Service;
import org.onap.ves.openapi.manager.service.validation.ArtifactsValidator;
@@ -107,7 +108,7 @@ class ClientCallbackTest {
// then
verifyMockedMethodCalls(testParameters, numberOfPulledArtefacts);
for(ArtifactsValidator validator: extraValidators) {
- verify(validator, times(1)).validate(eq(testParameters.getExpectedPulledArtifacts()));
+ verify(validator, times(1)).validate(testParameters.getExpectedPulledArtifacts());
}
}
@@ -137,10 +138,10 @@ class ClientCallbackTest {
}
private void verifyMockedMethodCalls(ExpectedTestParameters testParameters, int numberOfPulledArtifacts) {
- verify(artifactsCollector, times(1)).pullArtifacts(eq(testParameters.getExpectedArtifactsList()));
+ verify(artifactsCollector, times(1)).pullArtifacts(testParameters.getExpectedArtifactsList());
verify(artifactsCollectorStatusSender, times(numberOfPulledArtifacts)).sendDownloadOk(any(), eq(testParameters.getExpectedArtifactsList()));
verify(validationStatusSender, times(1)).send(any(), eq(testParameters.getExpectedValidationResults()));
- validators.forEach(validator -> verify(validator, times(1)).validate(eq(testParameters.getExpectedPulledArtifacts())));
+ validators.forEach(validator -> verify(validator, times(1)).validate(testParameters.getExpectedPulledArtifacts()));
}
@Getter