summaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap
diff options
context:
space:
mode:
authorArul.Nambi <arul.nambi@amdocs.com>2017-10-10 13:36:50 -0400
committerArul.Nambi <arul.nambi@amdocs.com>2017-10-10 13:37:57 -0400
commit645628777792e49ea18f245236953a9e5aa6c6f7 (patch)
treecf5a6e8b032a29bad34fd1c6a739306601e41460 /src/test/java/org/onap
parentdb2e2b074eeea255a798a684313453d260b4d682 (diff)
Increase junit coverage
Issue-ID: AAI-429 Change-Id: I8cd6c89bf7abd2d4d0d78bbf25fe6e5b5de53224 Signed-off-by: Arul.Nambi <arul.nambi@amdocs.com>
Diffstat (limited to 'src/test/java/org/onap')
-rw-r--r--src/test/java/org/onap/aai/sparky/analytics/AveragingRingBufferTest.java18
-rw-r--r--src/test/java/org/onap/aai/sparky/analytics/HistogramSamplerTest.java4
-rw-r--r--src/test/java/org/onap/aai/sparky/dal/rest/RestfulDataAccessorTest.java7
-rw-r--r--src/test/java/org/onap/aai/sparky/inventory/GeoIndexDocumentTest.java4
-rw-r--r--src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java4
-rw-r--r--src/test/java/org/onap/aai/sparky/synchronizer/SyncHelperTest.java14
-rw-r--r--src/test/java/org/onap/aai/sparky/synchronizer/entity/IndexableEntityTest.java43
-rw-r--r--src/test/java/org/onap/aai/sparky/viewandinspect/ViewAndInspectSearchRequestTest.java4
-rw-r--r--src/test/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntryTest.java5
9 files changed, 72 insertions, 31 deletions
diff --git a/src/test/java/org/onap/aai/sparky/analytics/AveragingRingBufferTest.java b/src/test/java/org/onap/aai/sparky/analytics/AveragingRingBufferTest.java
index a317c29..4c37c08 100644
--- a/src/test/java/org/onap/aai/sparky/analytics/AveragingRingBufferTest.java
+++ b/src/test/java/org/onap/aai/sparky/analytics/AveragingRingBufferTest.java
@@ -33,17 +33,31 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.aai.sparky.analytics.AveragingRingBuffer;
-import org.powermock.modules.junit4.PowerMockRunner;
+import org.mockito.runners.MockitoJUnitRunner;
/**
* The Class AveragingRingBufferTest.
*/
-@RunWith(PowerMockRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class AveragingRingBufferTest {
protected SecureRandom random = new SecureRandom();
/**
+ * @return the random
+ */
+ public SecureRandom getRandom() {
+ return random;
+ }
+
+ /**
+ * @param random the random to set
+ */
+ public void setRandom(SecureRandom random) {
+ this.random = random;
+ }
+
+ /**
* Inits the.
*
* @throws Exception the exception
diff --git a/src/test/java/org/onap/aai/sparky/analytics/HistogramSamplerTest.java b/src/test/java/org/onap/aai/sparky/analytics/HistogramSamplerTest.java
index 7304096..60a67d5 100644
--- a/src/test/java/org/onap/aai/sparky/analytics/HistogramSamplerTest.java
+++ b/src/test/java/org/onap/aai/sparky/analytics/HistogramSamplerTest.java
@@ -31,12 +31,12 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.aai.sparky.analytics.HistogramSampler;
-import org.powermock.modules.junit4.PowerMockRunner;
+import org.mockito.runners.MockitoJUnitRunner;
/**
* The Class HistogramSamplerTest.
*/
-@RunWith(PowerMockRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class HistogramSamplerTest {
protected SecureRandom random = new SecureRandom();
diff --git a/src/test/java/org/onap/aai/sparky/dal/rest/RestfulDataAccessorTest.java b/src/test/java/org/onap/aai/sparky/dal/rest/RestfulDataAccessorTest.java
index 0c9967d..fe6fa56 100644
--- a/src/test/java/org/onap/aai/sparky/dal/rest/RestfulDataAccessorTest.java
+++ b/src/test/java/org/onap/aai/sparky/dal/rest/RestfulDataAccessorTest.java
@@ -36,10 +36,7 @@ import static org.mockito.Mockito.mock;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.aai.sparky.dal.rest.OperationResult;
-import org.onap.aai.sparky.dal.rest.RestClientBuilder;
-import org.onap.aai.sparky.dal.rest.RestfulDataAccessor;
-import org.powermock.modules.junit4.PowerMockRunner;
+import org.mockito.runners.MockitoJUnitRunner;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
@@ -49,7 +46,7 @@ import com.sun.jersey.api.client.WebResource.Builder;
/**
* The Class RestfulDataAccessorTest.
*/
-@RunWith(PowerMockRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class RestfulDataAccessorTest {
private RestClientBuilder clientBuilderMock;
diff --git a/src/test/java/org/onap/aai/sparky/inventory/GeoIndexDocumentTest.java b/src/test/java/org/onap/aai/sparky/inventory/GeoIndexDocumentTest.java
index 2a8a945..d2cddcb 100644
--- a/src/test/java/org/onap/aai/sparky/inventory/GeoIndexDocumentTest.java
+++ b/src/test/java/org/onap/aai/sparky/inventory/GeoIndexDocumentTest.java
@@ -31,13 +31,13 @@ import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.runners.MockitoJUnitRunner;
import org.onap.aai.sparky.inventory.entity.GeoIndexDocument;
-import org.powermock.modules.junit4.PowerMockRunner;
/**
* The Class GeoIndexDocumentTest.
*/
-@RunWith(PowerMockRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class GeoIndexDocumentTest {
/**
diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java b/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java
index eeebac8..822e927 100644
--- a/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java
+++ b/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java
@@ -32,9 +32,9 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
+import org.mockito.runners.MockitoJUnitRunner;
import org.onap.aai.sparky.config.oxm.OxmModelLoader;
import org.onap.aai.sparky.util.LogValidator;
-import org.powermock.modules.junit4.PowerMockRunner;
import ch.qos.logback.classic.Level;
@@ -42,7 +42,7 @@ import ch.qos.logback.classic.Level;
/**
* The Class IndexDocumentTest.
*/
-@RunWith(PowerMockRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class IndexDocumentTest {
private LogValidator logValidator;
diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/SyncHelperTest.java b/src/test/java/org/onap/aai/sparky/synchronizer/SyncHelperTest.java
index 55688d9..b4305cb 100644
--- a/src/test/java/org/onap/aai/sparky/synchronizer/SyncHelperTest.java
+++ b/src/test/java/org/onap/aai/sparky/synchronizer/SyncHelperTest.java
@@ -1,28 +1,16 @@
package org.onap.aai.sparky.synchronizer;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
-import java.util.Properties;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.onap.aai.sparky.config.oxm.OxmModelLoader;
-import org.onap.aai.sparky.dal.aai.config.ActiveInventoryConfig;
-import org.onap.aai.sparky.dal.aai.config.ActiveInventorySslConfig;
-import org.onap.aai.sparky.dal.elasticsearch.config.ElasticSearchConfig;
-import org.onap.aai.sparky.synchronizer.config.SynchronizerConfiguration;
-import org.onap.aai.sparky.synchronizer.config.TaskProcessorConfig;
-import org.onap.aai.sparky.util.Encryptor;
import org.onap.aai.sparky.viewandinspect.config.TierSupportUiConstants;
-import org.junit.*;
-import static org.junit.Assert.*;
-import org.onap.aai.sparky.synchronizer.SyncHelper;
@RunWith(MockitoJUnitRunner.class)
public class SyncHelperTest {
diff --git a/src/test/java/org/onap/aai/sparky/synchronizer/entity/IndexableEntityTest.java b/src/test/java/org/onap/aai/sparky/synchronizer/entity/IndexableEntityTest.java
new file mode 100644
index 0000000..7da2d6e
--- /dev/null
+++ b/src/test/java/org/onap/aai/sparky/synchronizer/entity/IndexableEntityTest.java
@@ -0,0 +1,43 @@
+package org.onap.aai.sparky.synchronizer.entity;
+
+import org.junit.Test;
+
+import com.openpojo.reflection.PojoClass;
+import com.openpojo.reflection.impl.PojoClassFactory;
+import com.openpojo.validation.PojoValidator;
+import com.openpojo.validation.Validator;
+import com.openpojo.validation.ValidatorBuilder;
+import com.openpojo.validation.rule.impl.GetterMustExistRule;
+import com.openpojo.validation.rule.impl.SetterMustExistRule;
+import com.openpojo.validation.test.impl.GetterTester;
+import com.openpojo.validation.test.impl.SetterTester;
+
+public class IndexableEntityTest {
+// The package to be tested
+ private String packageName = "org.onap.aai.sparky.synchronizer.entity";
+
+ /**
+ * @return the packageName
+ */
+ public String getPackageName() {
+ return packageName;
+ }
+
+ /**
+ * @param packageName the packageName to set
+ */
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+
+ @Test
+ public void validate() {
+ Validator validator = ValidatorBuilder.create()
+ .with(new SetterMustExistRule(),
+ new GetterMustExistRule())
+ .with(new SetterTester(),
+ new GetterTester())
+ .build();
+ validator.validate(packageName);
+ }
+}
diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/ViewAndInspectSearchRequestTest.java b/src/test/java/org/onap/aai/sparky/viewandinspect/ViewAndInspectSearchRequestTest.java
index 0fff1fb..15d46dd 100644
--- a/src/test/java/org/onap/aai/sparky/viewandinspect/ViewAndInspectSearchRequestTest.java
+++ b/src/test/java/org/onap/aai/sparky/viewandinspect/ViewAndInspectSearchRequestTest.java
@@ -32,13 +32,13 @@ import static org.junit.Assert.assertNull;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.runners.MockitoJUnitRunner;
import org.onap.aai.sparky.viewandinspect.entity.QuerySearchEntity;
-import org.powermock.modules.junit4.PowerMockRunner;
/**
* The Class ViewAndInspectSearchRequestTest.
*/
-@RunWith(PowerMockRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class ViewAndInspectSearchRequestTest {
/**
diff --git a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntryTest.java b/src/test/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntryTest.java
index 496ceb2..023855b 100644
--- a/src/test/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntryTest.java
+++ b/src/test/java/org/onap/aai/sparky/viewandinspect/entity/EntityEntryTest.java
@@ -34,13 +34,12 @@ import java.security.NoSuchAlgorithmException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.aai.sparky.viewandinspect.entity.EntityEntry;
-import org.powermock.modules.junit4.PowerMockRunner;
+import org.mockito.runners.MockitoJUnitRunner;
/**
* The Class EntityEntryTest.
*/
-@RunWith(PowerMockRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class EntityEntryTest {
/**