aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2021-03-27 00:25:53 +0000
committerChristophe Closset <christophe.closset@intl.att.com>2021-03-29 07:03:51 +0000
commit59f4edc21e410e158a79e1bff842f9623126a453 (patch)
tree59e8acd2d36dc080eb9472d576e9f973efc25300
parent0358e1dfa8f3b3b83ccfca68209ec36c0d25ca8b (diff)
Improve test coverage
Fix test directory structure Change-Id: Iabd6c06424f1a58bd311da4b071853a05e2816f1 Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3428
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntityTest.java (renamed from openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntityTest.java)11
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntityTest.java (renamed from openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntityTest.java)11
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/ServiceArtifactEntityTest.java (renamed from openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/ServiceArtifactEntityTest.java)11
-rw-r--r--openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/ServiceTemplateEntityTest.java (renamed from openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/ServiceTemplateEntityTest.java)11
4 files changed, 20 insertions, 24 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntityTest.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntityTest.java
index dfd0b887f5..8ebfad3524 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntityTest.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/EnrichedServiceArtifactEntityTest.java
@@ -34,8 +34,7 @@ import org.junit.jupiter.api.Test;
import org.openecomp.sdc.common.errors.SdcRuntimeException;
import org.openecomp.sdc.versioning.dao.types.Version;
-
-public class EnrichedServiceArtifactEntityTest {
+class EnrichedServiceArtifactEntityTest {
private static final byte[] BYTE_ARRAY = new byte[]{0xA, 0xB, 0xC, 0xD};
@@ -49,21 +48,21 @@ public class EnrichedServiceArtifactEntityTest {
}
@Test
- public void shouldReturnNonEmptyEntityType() {
+ void shouldReturnNonEmptyEntityType() {
EnrichedServiceArtifactEntity entity =
new EnrichedServiceArtifactEntity();
assertTrue(StringUtils.isNoneEmpty(entity.getEntityType()));
}
@Test
- public void shouldHaveFirstClassCitizenIdEqualToVspId() {
+ void shouldHaveFirstClassCitizenIdEqualToVspId() {
EnrichedServiceArtifactEntity entity =
new EnrichedServiceArtifactEntity(createServiceArtifact());
assertEquals(entity.getId(), entity.getFirstClassCitizenId());
}
@Test
- public void serviceArtifactGetterShouldReturnCorrectData() throws IOException {
+ void serviceArtifactGetterShouldReturnCorrectData() throws IOException {
ServiceArtifact serviceArtifact = createServiceArtifact();
EnrichedServiceArtifactEntity entity =
new EnrichedServiceArtifactEntity(serviceArtifact);
@@ -77,7 +76,7 @@ public class EnrichedServiceArtifactEntityTest {
}
@Test
- public void shouldFailOnNullContentBytesSupplied() {
+ void shouldFailOnNullContentBytesSupplied() {
ServiceArtifact serviceArtifactMock = mock(ServiceArtifact.class);
given(serviceArtifactMock.getContent()).willAnswer(invocation -> {
throw new IOException("Test exception");
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntityTest.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntityTest.java
index 6654436e72..d6b94e3248 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntityTest.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/EnrichedServiceTemplateEntityTest.java
@@ -34,8 +34,7 @@ import org.junit.jupiter.api.Test;
import org.openecomp.sdc.common.errors.SdcRuntimeException;
import org.openecomp.sdc.versioning.dao.types.Version;
-
-public class EnrichedServiceTemplateEntityTest {
+class EnrichedServiceTemplateEntityTest {
private static final byte[] BYTE_ARRAY = new byte[]{0xA, 0xB, 0xC, 0xD};
@@ -49,21 +48,21 @@ public class EnrichedServiceTemplateEntityTest {
}
@Test
- public void shouldReturnNonEmptyEntityType() {
+ void shouldReturnNonEmptyEntityType() {
EnrichedServiceTemplateEntity entity =
new EnrichedServiceTemplateEntity();
assertTrue(StringUtils.isNoneEmpty(entity.getEntityType()));
}
@Test
- public void shouldHaveFirstClassCitizenIdEqualToVspId() {
+ void shouldHaveFirstClassCitizenIdEqualToVspId() {
EnrichedServiceTemplateEntity entity =
new EnrichedServiceTemplateEntity(createServiceTemplate());
assertEquals(entity.getId(), entity.getFirstClassCitizenId());
}
@Test
- public void serviceTemplateGetterShouldReturnCorrectData() throws IOException {
+ void serviceTemplateGetterShouldReturnCorrectData() throws IOException {
ServiceTemplate serviceTemplate = createServiceTemplate();
EnrichedServiceTemplateEntity entity =
new EnrichedServiceTemplateEntity(serviceTemplate);
@@ -77,7 +76,7 @@ public class EnrichedServiceTemplateEntityTest {
}
@Test
- public void shouldFailOnNullContentBytesSupplied() {
+ void shouldFailOnNullContentBytesSupplied() {
ServiceTemplate serviceTemplateMock = mock(ServiceTemplate.class);
given(serviceTemplateMock.getContent()).willAnswer(invocation -> {
throw new IOException("Test exception");
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/ServiceArtifactEntityTest.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/ServiceArtifactEntityTest.java
index 109f8d0bee..49bb271247 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/ServiceArtifactEntityTest.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/ServiceArtifactEntityTest.java
@@ -34,8 +34,7 @@ import org.junit.jupiter.api.Test;
import org.openecomp.sdc.common.errors.SdcRuntimeException;
import org.openecomp.sdc.versioning.dao.types.Version;
-
-public class ServiceArtifactEntityTest {
+class ServiceArtifactEntityTest {
private static final byte[] BYTE_ARRAY = new byte[]{0xA, 0xB, 0xC, 0xD};
@@ -49,21 +48,21 @@ public class ServiceArtifactEntityTest {
}
@Test
- public void shouldReturnNonEmptyEntityType() {
+ void shouldReturnNonEmptyEntityType() {
ServiceArtifactEntity entity =
new ServiceArtifactEntity();
assertTrue(StringUtils.isNoneEmpty(entity.getEntityType()));
}
@Test
- public void shouldHaveFirstClassCitizenIdEqualToVspId() {
+ void shouldHaveFirstClassCitizenIdEqualToVspId() {
ServiceArtifactEntity entity =
new ServiceArtifactEntity(createServiceArtifact());
assertEquals(entity.getId(), entity.getFirstClassCitizenId());
}
@Test
- public void serviceArtifactGetterShouldReturnCorrectData() throws IOException {
+ void serviceArtifactGetterShouldReturnCorrectData() throws IOException {
ServiceArtifact serviceArtifact = createServiceArtifact();
ServiceArtifactEntity entity =
new ServiceArtifactEntity(serviceArtifact);
@@ -77,7 +76,7 @@ public class ServiceArtifactEntityTest {
}
@Test
- public void shouldFailOnNullContentBytesSupplied() {
+ void shouldFailOnNullContentBytesSupplied() {
ServiceArtifact serviceArtifactMock = mock(ServiceArtifact.class);
given(serviceArtifactMock.getContent()).willAnswer(invocation -> {
throw new IOException("Test exception");
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/ServiceTemplateEntityTest.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/ServiceTemplateEntityTest.java
index ad4d6b1fe4..07b5a9518e 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/conflict-rest/conflict-rest-services/src/test/java/org/openecomp/core/model/types/ServiceTemplateEntityTest.java
+++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/test/java/org/openecomp/core/model/types/ServiceTemplateEntityTest.java
@@ -34,8 +34,7 @@ import org.junit.jupiter.api.Test;
import org.openecomp.sdc.common.errors.SdcRuntimeException;
import org.openecomp.sdc.versioning.dao.types.Version;
-
-public class ServiceTemplateEntityTest {
+class ServiceTemplateEntityTest {
private static final byte[] BYTE_ARRAY = new byte[]{0xA, 0xB, 0xC, 0xD};
@@ -49,21 +48,21 @@ public class ServiceTemplateEntityTest {
}
@Test
- public void shouldReturnNonEmptyEntityType() {
+ void shouldReturnNonEmptyEntityType() {
ServiceTemplateEntity entity =
new ServiceTemplateEntity();
assertTrue(StringUtils.isNoneEmpty(entity.getEntityType()));
}
@Test
- public void shouldHaveFirstClassCitizenIdEqualToVspId() {
+ void shouldHaveFirstClassCitizenIdEqualToVspId() {
ServiceTemplateEntity entity =
new ServiceTemplateEntity(createServiceTemplate());
assertEquals(entity.getId(), entity.getFirstClassCitizenId());
}
@Test
- public void serviceTemplateGetterShouldReturnCorrectData() throws IOException {
+ void serviceTemplateGetterShouldReturnCorrectData() throws IOException {
ServiceTemplate serviceTemplate = createServiceTemplate();
ServiceTemplateEntity entity =
new ServiceTemplateEntity(serviceTemplate);
@@ -77,7 +76,7 @@ public class ServiceTemplateEntityTest {
}
@Test
- public void shouldFailOnNullContentBytesSupplied() {
+ void shouldFailOnNullContentBytesSupplied() {
ServiceTemplate serviceTemplateMock = mock(ServiceTemplate.class);
given(serviceTemplateMock.getContent()).willAnswer(invocation -> {
throw new IOException("Test exception");