summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-03-15 11:26:17 +0100
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2018-03-15 11:26:17 +0100
commitb646d524270c8ca093974751b6696e0c0e0b3a08 (patch)
tree5694a5ab2d99a188ad2ae5c124afd5de0cf84521 /src/test
parentb3737db89cab5d43b7ef18f32052a9749487e1bb (diff)
Fix Checkstyle issues
Fix the checkstyle issues reported by the build Issue-ID: CLAMP-74 Change-Id: Ia2b3e332808d59aefcc7140d9638c7a18ef24e65 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java4
-rw-r--r--src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java16
-rw-r--r--src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java2
-rw-r--r--src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java4
-rw-r--r--src/test/java/org/onap/clamp/clds/model/CldsDbServiceCacheTest.java (renamed from src/test/java/org/onap/clamp/clds/model/CldsDBServiceCacheTest.java)6
-rw-r--r--src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java18
-rw-r--r--src/test/java/org/onap/clamp/clds/transform/XslTransformerTest.java1
7 files changed, 24 insertions, 27 deletions
diff --git a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java b/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
index 287bc1791..ecef30ee4 100644
--- a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
+++ b/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
@@ -40,7 +40,7 @@ import org.onap.clamp.clds.util.ResourceFileUtil;
*/
public class SdcSingleControllerConfigurationTest {
- public final SdcSingleControllerConfiguration loadControllerConfiguration(String fileName, String sdcControllerName)
+ private SdcSingleControllerConfiguration loadControllerConfiguration(String fileName, String sdcControllerName)
throws JsonParseException, JsonMappingException, IOException {
JsonNode jsonNode = new ObjectMapper().readValue(ResourceFileUtil.getResourceAsStream(fileName),
JsonNode.class);
@@ -78,7 +78,7 @@ public class SdcSingleControllerConfigurationTest {
}
@Test
- public final void testConsumerGroupWithNULL() throws JsonParseException, JsonMappingException, IOException {
+ public final void testConsumerGroupWithNull() throws JsonParseException, JsonMappingException, IOException {
SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-NULL.json",
"sdc-controller1");
assertTrue(sdcConfig.getConsumerGroup() == null);
diff --git a/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java
index 861921c13..ba37b57f8 100644
--- a/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/CldsDaoItCase.java
@@ -44,8 +44,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.clamp.clds.client.req.sdc.SdcCatalogServices;
import org.onap.clamp.clds.dao.CldsDao;
-import org.onap.clamp.clds.model.CLDSMonitoringDetails;
-import org.onap.clamp.clds.model.CldsDBServiceCache;
+import org.onap.clamp.clds.model.CldsMonitoringDetails;
+import org.onap.clamp.clds.model.CldsDbServiceCache;
import org.onap.clamp.clds.model.CldsEvent;
import org.onap.clamp.clds.model.CldsModel;
import org.onap.clamp.clds.model.CldsServiceData;
@@ -156,13 +156,11 @@ public class CldsDaoItCase {
}
@Test
- public void testGetCLDSMonitoringDetails() {
- List<CLDSMonitoringDetails> cldsMonitoringDetailsList = new ArrayList<CLDSMonitoringDetails>();
+ public void testGetCldsMonitoringDetails() {
+ List<CldsMonitoringDetails> cldsMonitoringDetailsList = new ArrayList<CldsMonitoringDetails>();
cldsMonitoringDetailsList = cldsDao.getCLDSMonitoringDetails();
cldsMonitoringDetailsList.forEach(clName -> {
- logger.info(clName.getCloseloopName()); // Uncomment this line to
- // view the result on
- // console
+ logger.info(clName.getCloseloopName());
assertNotNull(clName.getCloseloopName());
});
}
@@ -174,7 +172,7 @@ public class CldsDaoItCase {
// Test not in cache so should be null
CldsServiceData cldsServiceDataCache = cldsDao.getCldsServiceCache("4cc5b45a-1f63-4194-8100-cd8e14248c92");
assertNull(cldsServiceDataCache);
- cldsDao.setCldsServiceCache(new CldsDBServiceCache(cldsServiceData));
+ cldsDao.setCldsServiceCache(new CldsDbServiceCache(cldsServiceData));
cldsServiceDataCache = cldsDao.getCldsServiceCache("4cc5b45a-1f63-4194-8100-cd8e14248c92");
assertNotNull(cldsServiceDataCache);
assertEquals("56441b4b-0467-41dc-9a0e-e68613838219", cldsServiceDataCache.getServiceUUID());
@@ -187,7 +185,7 @@ public class CldsDaoItCase {
assertEquals(0, cldsServiceDataCache.getCldsVfs().get(0).getCldsKPIList().size());
// Second update
cldsServiceData.setCldsVfs(null);
- cldsDao.setCldsServiceCache(new CldsDBServiceCache(cldsServiceData));
+ cldsDao.setCldsServiceCache(new CldsDbServiceCache(cldsServiceData));
cldsServiceDataCache = cldsDao.getCldsServiceCache("4cc5b45a-1f63-4194-8100-cd8e14248c92");
assertNotNull(cldsServiceDataCache);
assertNull(cldsServiceDataCache.getCldsVfs());
diff --git a/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java
index c2b6fb167..a699ca769 100644
--- a/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/CldsServiceItCase.java
@@ -183,7 +183,7 @@ public class CldsServiceItCase {
}
@Test
- public void testGetSdcPropertiesByServiceUUIDForRefresh()
+ public void testGetSdcPropertiesByServiceUuidForRefresh()
throws GeneralSecurityException, DecoderException, JSONException, IOException {
SecurityContext securityContext = Mockito.mock(SecurityContext.class);
Principal principal = Mockito.mock(Principal.class);
diff --git a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java b/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java
index 43fc95981..e080baccc 100644
--- a/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java
+++ b/src/test/java/org/onap/clamp/clds/it/config/CldsReferencePropertiesItCase.java
@@ -50,11 +50,9 @@ public class CldsReferencePropertiesItCase {
/**
* Test getting a value the properties in string.
- *
- * @throws IOException
*/
@Test
- public void testGetStringValue() throws IOException {
+ public void testGetStringValue() {
assertEquals(refProp.getStringValue("policy.onap.name"), "DCAE");
assertEquals(refProp.getStringValue("policy.ms.policyNamePrefix", ""), "Config_MS_");
assertEquals(refProp.getStringValue("policy.ms.policyNamePrefix", "testos"), "Config_MS_");
diff --git a/src/test/java/org/onap/clamp/clds/model/CldsDBServiceCacheTest.java b/src/test/java/org/onap/clamp/clds/model/CldsDbServiceCacheTest.java
index ad1689157..447e25531 100644
--- a/src/test/java/org/onap/clamp/clds/model/CldsDBServiceCacheTest.java
+++ b/src/test/java/org/onap/clamp/clds/model/CldsDbServiceCacheTest.java
@@ -33,7 +33,7 @@ import java.util.List;
import org.junit.Test;
-public class CldsDBServiceCacheTest {
+public class CldsDbServiceCacheTest {
@Test
public void testConstructor() throws IOException, ClassNotFoundException {
@@ -52,8 +52,8 @@ public class CldsDBServiceCacheTest {
cldsVfData.setCldsKPIList(cldsKPIList);
cldsVfs.add(cldsVfData);
cldsServiceData.setCldsVfs(cldsVfs);
- CldsDBServiceCache cldsDBServiceCache = new CldsDBServiceCache(cldsServiceData);
- ObjectInputStream reader = new ObjectInputStream(cldsDBServiceCache.getCldsDataInstream());
+ CldsDbServiceCache cldsDbServiceCache = new CldsDbServiceCache(cldsServiceData);
+ ObjectInputStream reader = new ObjectInputStream(cldsDbServiceCache.getCldsDataInstream());
CldsServiceData cldsServiceDataResult = (CldsServiceData) reader.readObject();
assertNotNull(cldsServiceDataResult);
assertNotNull(cldsServiceDataResult.getCldsVfs());
diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java
index 4c3ab86b7..d1b177d22 100644
--- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java
+++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java
@@ -68,17 +68,17 @@ public class CsarHandlerTest {
Mockito.when(serviceArtifact.getArtifactName()).thenReturn(csarArtifactName);
List<IArtifactInfo> servicesList = new ArrayList<>();
servicesList.add(serviceArtifact);
- INotificationData iNotifData = Mockito.mock(INotificationData.class);
- Mockito.when(iNotifData.getServiceArtifacts()).thenReturn(servicesList);
- CsarHandler csar = new CsarHandler(iNotifData, "test-controller", sdcFolder);
+ INotificationData notifData = Mockito.mock(INotificationData.class);
+ Mockito.when(notifData.getServiceArtifacts()).thenReturn(servicesList);
+ CsarHandler csar = new CsarHandler(notifData, "test-controller", sdcFolder);
assertEquals(sdcFolder + "/test-controller" + "/" + csarArtifactName, csar.getFilePath());
}
@Test(expected = CsarHandlerException.class)
public void testFailingConstructor() throws CsarHandlerException {
- INotificationData iNotifData = Mockito.mock(INotificationData.class);
- Mockito.when(iNotifData.getServiceArtifacts()).thenReturn(new ArrayList<>());
- new CsarHandler(iNotifData, "test-controller", "/tmp/csar-handler-tests");
+ INotificationData notifData = Mockito.mock(INotificationData.class);
+ Mockito.when(notifData.getServiceArtifacts()).thenReturn(new ArrayList<>());
+ new CsarHandler(notifData, "test-controller", "/tmp/csar-handler-tests");
fail("Exception should have been raised");
}
@@ -90,9 +90,9 @@ public class CsarHandlerTest {
Mockito.when(serviceArtifact.getArtifactName()).thenReturn(csarArtifactName);
List<IArtifactInfo> servicesList = new ArrayList<>();
servicesList.add(serviceArtifact);
- INotificationData iNotifData = Mockito.mock(INotificationData.class);
- Mockito.when(iNotifData.getServiceArtifacts()).thenReturn(servicesList);
- CsarHandler csar = new CsarHandler(iNotifData, "test-controller", "/tmp/csar-handler-tests");
+ INotificationData notifData = Mockito.mock(INotificationData.class);
+ Mockito.when(notifData.getServiceArtifacts()).thenReturn(servicesList);
+ CsarHandler csar = new CsarHandler(notifData, "test-controller", "/tmp/csar-handler-tests");
IDistributionClientDownloadResult resultArtifact = Mockito.mock(IDistributionClientDownloadResult.class);
Mockito.when(resultArtifact.getArtifactPayload()).thenReturn(
IOUtils.toByteArray(ResourceFileUtil.getResourceAsStream("example/sdc/service-Simsfoimap0112.csar")));
diff --git a/src/test/java/org/onap/clamp/clds/transform/XslTransformerTest.java b/src/test/java/org/onap/clamp/clds/transform/XslTransformerTest.java
index fd61ef4ed..2570aeb44 100644
--- a/src/test/java/org/onap/clamp/clds/transform/XslTransformerTest.java
+++ b/src/test/java/org/onap/clamp/clds/transform/XslTransformerTest.java
@@ -44,6 +44,7 @@ public class XslTransformerTest {
* @throws IOException
* In case of issues
* @throws JSONException
+ * In case of issues to decode Json
*/
@Test
public void xslTransformTest() throws TransformerException, IOException, JSONException {