From 645628777792e49ea18f245236953a9e5aa6c6f7 Mon Sep 17 00:00:00 2001 From: "Arul.Nambi" Date: Tue, 10 Oct 2017 13:36:50 -0400 Subject: Increase junit coverage Issue-ID: AAI-429 Change-Id: I8cd6c89bf7abd2d4d0d78bbf25fe6e5b5de53224 Signed-off-by: Arul.Nambi --- pom.xml | 6 ++ .../synchronizer/ElasticSearchIndexCleaner.java | 8 +-- .../onap/aai/sparky/synchronizer/SyncHelper.java | 10 ++- .../synchronizer/entity/AggregationEntity.java | 30 ++++++++- .../entity/AggregationSuggestionEntity.java | 35 +++++++++++ .../entity/IndexableCrossEntityReference.java | 44 +++++++++++++- .../synchronizer/entity/IndexableEntity.java | 38 +++++++++++- .../sparky/synchronizer/entity/MergableEntity.java | 13 +++- .../synchronizer/entity/ObjectIdCollection.java | 21 ++++++- .../synchronizer/entity/SearchableEntity.java | 42 +++++++++++++ .../entity/SuggestionSearchEntity.java | 71 ++++++++++++++++++++++ .../entity/TransactionStorageType.java | 17 +++++- .../sparky/analytics/AveragingRingBufferTest.java | 18 +++++- .../aai/sparky/analytics/HistogramSamplerTest.java | 4 +- .../sparky/dal/rest/RestfulDataAccessorTest.java | 7 +-- .../aai/sparky/inventory/GeoIndexDocumentTest.java | 4 +- .../aai/sparky/synchronizer/IndexDocumentTest.java | 4 +- .../aai/sparky/synchronizer/SyncHelperTest.java | 14 +---- .../synchronizer/entity/IndexableEntityTest.java | 43 +++++++++++++ .../ViewAndInspectSearchRequestTest.java | 4 +- .../viewandinspect/entity/EntityEntryTest.java | 5 +- 21 files changed, 394 insertions(+), 44 deletions(-) create mode 100644 src/test/java/org/onap/aai/sparky/synchronizer/entity/IndexableEntityTest.java diff --git a/pom.xml b/pom.xml index 4fdea22..01f35b9 100644 --- a/pom.xml +++ b/pom.xml @@ -186,6 +186,12 @@ 1.2.17 + + com.openpojo + openpojo + 0.8.6 + + org.onap.portal.sdk epsdk-fw diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/ElasticSearchIndexCleaner.java b/src/main/java/org/onap/aai/sparky/synchronizer/ElasticSearchIndexCleaner.java index 74cb1cb..842a416 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/ElasticSearchIndexCleaner.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/ElasticSearchIndexCleaner.java @@ -145,8 +145,8 @@ public class ElasticSearchIndexCleaner implements IndexCleaner { if (sizeAfter > 0) { - Collection presyncIds = before.getImportedObjectIds(); - presyncIds.removeAll(after.getImportedObjectIds()); + Collection presyncIds = before.getImportedObjectIdsAsValues(); + presyncIds.removeAll(after.getImportedObjectIdsAsValues()); try { LOG.info(AaiUiMsgs.ES_SYNC_SELECTIVE_DELETE, indexName, indexType, @@ -165,7 +165,7 @@ public class ElasticSearchIndexCleaner implements IndexCleaner { if (numItemsInBulkRequest >= this.numItemsToGetBulkRequest) { LOG.info(AaiUiMsgs.ES_BULK_DELETE, indexName, String.valueOf(bulkIds.getSize())); - OperationResult bulkDeleteResult = bulkDelete(bulkIds.getImportedObjectIds()); + OperationResult bulkDeleteResult = bulkDelete(bulkIds.getImportedObjectIdsAsValues()); // pegCountersForElasticBulkDelete(bulkDeleteResult); numItemsRemainingToBeDeleted -= numItemsInBulkRequest; numItemsInBulkRequest = 0; @@ -175,7 +175,7 @@ public class ElasticSearchIndexCleaner implements IndexCleaner { if (numItemsRemainingToBeDeleted > 0) { LOG.info(AaiUiMsgs.ES_BULK_DELETE, indexName, String.valueOf(bulkIds.getSize())); - OperationResult bulkDeleteResult = bulkDelete(bulkIds.getImportedObjectIds()); + OperationResult bulkDeleteResult = bulkDelete(bulkIds.getImportedObjectIdsAsValues()); // pegCountersForElasticBulkDelete(bulkDeleteResult); } diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/SyncHelper.java b/src/main/java/org/onap/aai/sparky/synchronizer/SyncHelper.java index 3738acf..617eb08 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/SyncHelper.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/SyncHelper.java @@ -92,7 +92,15 @@ public class SyncHelper { private boolean isInitialSync; - /** + public boolean isInitialSync() { + return isInitialSync; + } + + public void setInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + } + + /** * Instantiates a new sync task. * * @param initialSync the initial sync diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/entity/AggregationEntity.java b/src/main/java/org/onap/aai/sparky/synchronizer/entity/AggregationEntity.java index ff22ba0..af8159a 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/entity/AggregationEntity.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/entity/AggregationEntity.java @@ -93,7 +93,35 @@ public class AggregationEntity extends IndexableEntity implements IndexDocument return rootNode.toString(); } - @Override + /** + * @return the attributes + */ + public Map getAttributes() { + return attributes; + } + + /** + * @param attributes the attributes to set + */ + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + /** + * @return the mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * @param mapper the mapper to set + */ + public void setMapper(ObjectMapper mapper) { + this.mapper = mapper; + } + +@Override public ObjectNode getBulkImportEntity() { // TODO Auto-generated method stub return null; diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/entity/AggregationSuggestionEntity.java b/src/main/java/org/onap/aai/sparky/synchronizer/entity/AggregationSuggestionEntity.java index d7755e2..145b23f 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/entity/AggregationSuggestionEntity.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/entity/AggregationSuggestionEntity.java @@ -35,6 +35,41 @@ import org.onap.aai.sparky.util.NodeUtils; public class AggregationSuggestionEntity extends IndexableEntity implements IndexDocument { private List inputs = new ArrayList(); + /** + * @return the inputs + */ + public List getInputs() { + return inputs; + } + + /** + * @param inputs the inputs to set + */ + public void setInputs(List inputs) { + this.inputs = inputs; + } + + /** + * @return the mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * @param mapper the mapper to set + */ + public void setMapper(ObjectMapper mapper) { + this.mapper = mapper; + } + + /** + * @return the outputString + */ + public String getOutputString() { + return outputString; + } + private final String outputString = "VNFs"; protected ObjectMapper mapper = new ObjectMapper(); diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/entity/IndexableCrossEntityReference.java b/src/main/java/org/onap/aai/sparky/synchronizer/entity/IndexableCrossEntityReference.java index aa604fb..bb564f3 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/entity/IndexableCrossEntityReference.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/entity/IndexableCrossEntityReference.java @@ -38,7 +38,49 @@ import com.fasterxml.jackson.databind.node.ObjectNode; public class IndexableCrossEntityReference extends IndexableEntity implements IndexDocument { protected String crossReferenceEntityValues; - protected ArrayList crossEntityReferenceCollection = new ArrayList(); + /** + * @return the crossReferenceEntityValues + */ + public String getCrossReferenceEntityValues() { + return crossReferenceEntityValues; + } + + /** + * @param crossReferenceEntityValues the crossReferenceEntityValues to set + */ + public void setCrossReferenceEntityValues(String crossReferenceEntityValues) { + this.crossReferenceEntityValues = crossReferenceEntityValues; + } + + /** + * @return the crossEntityReferenceCollection + */ + public ArrayList getCrossEntityReferenceCollection() { + return crossEntityReferenceCollection; + } + + /** + * @param crossEntityReferenceCollection the crossEntityReferenceCollection to set + */ + public void setCrossEntityReferenceCollection(ArrayList crossEntityReferenceCollection) { + this.crossEntityReferenceCollection = crossEntityReferenceCollection; + } + +/** + * @return the mapper + */ +public ObjectMapper getMapper() { + return mapper; +} + +/** + * @param mapper the mapper to set + */ +public void setMapper(ObjectMapper mapper) { + this.mapper = mapper; +} + +protected ArrayList crossEntityReferenceCollection = new ArrayList(); protected ObjectMapper mapper = new ObjectMapper(); /** diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/entity/IndexableEntity.java b/src/main/java/org/onap/aai/sparky/synchronizer/entity/IndexableEntity.java index 342f8df..4c9a5c6 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/entity/IndexableEntity.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/entity/IndexableEntity.java @@ -35,7 +35,43 @@ public abstract class IndexableEntity { protected String entityType; protected String entityPrimaryKeyValue; protected String lastmodTimestamp; - protected String link; + + /** + * @return the lastmodTimestamp + */ + public String getLastmodTimestamp() { + return lastmodTimestamp; + } + + /** + * @param lastmodTimestamp the lastmodTimestamp to set + */ + public void setLastmodTimestamp(String lastmodTimestamp) { + this.lastmodTimestamp = lastmodTimestamp; + } + + /** + * @return the loader + */ + public OxmModelLoader getLoader() { + return loader; + } + + /** + * @param loader the loader to set + */ + public void setLoader(OxmModelLoader loader) { + this.loader = loader; + } + + /** + * @return the timestampFormat + */ + public static String getTimestampFormat() { + return TIMESTAMP_FORMAT; + } + +protected String link; protected OxmModelLoader loader; private static final String TIMESTAMP_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/entity/MergableEntity.java b/src/main/java/org/onap/aai/sparky/synchronizer/entity/MergableEntity.java index 1935ed9..f709ee0 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/entity/MergableEntity.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/entity/MergableEntity.java @@ -35,6 +35,13 @@ public class MergableEntity { private Map other = new HashMap(); /** + * @param other the other to set + */ +public void setOther(Map other) { + this.other = other; +} + +/** * Any. * * @return the map @@ -44,7 +51,11 @@ public class MergableEntity { return other; } - /** + public Map getOther() { + return other; +} + +/** * Sets the. * * @param name the name diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/entity/ObjectIdCollection.java b/src/main/java/org/onap/aai/sparky/synchronizer/entity/ObjectIdCollection.java index e423934..e17c430 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/entity/ObjectIdCollection.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/entity/ObjectIdCollection.java @@ -34,9 +34,24 @@ public class ObjectIdCollection { protected ConcurrentHashMap importedObjectIds = new ConcurrentHashMap(); - public Collection getImportedObjectIds() { - return importedObjectIds.values(); - } + /** + * @return the importedObjectIds + */ + public ConcurrentHashMap getImportedObjectIds() { + return importedObjectIds; + } + + /** + * @param importedObjectIds + * the importedObjectIds to set + */ + public void setImportedObjectIds(ConcurrentHashMap importedObjectIds) { + this.importedObjectIds = importedObjectIds; + } + + public Collection getImportedObjectIdsAsValues() { + return importedObjectIds.values(); + } /** * Adds the object id. diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/entity/SearchableEntity.java b/src/main/java/org/onap/aai/sparky/synchronizer/entity/SearchableEntity.java index 46ef7f6..e7cfab1 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/entity/SearchableEntity.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/entity/SearchableEntity.java @@ -36,6 +36,48 @@ import org.onap.aai.sparky.util.NodeUtils; */ public class SearchableEntity extends IndexableEntity implements IndexDocument { protected List searchTagCollection = new ArrayList(); + /** + * @return the mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * @param mapper the mapper to set + */ + public void setMapper(ObjectMapper mapper) { + this.mapper = mapper; + } + + /** + * @param searchTagCollection the searchTagCollection to set + */ + public void setSearchTagCollection(List searchTagCollection) { + this.searchTagCollection = searchTagCollection; + } + + /** + * @param searchTagIdCollection the searchTagIdCollection to set + */ + public void setSearchTagIdCollection(List searchTagIdCollection) { + this.searchTagIdCollection = searchTagIdCollection; + } + + /** + * @param searchTags the searchTags to set + */ + public void setSearchTags(String searchTags) { + this.searchTags = searchTags; + } + + /** + * @param searchTagIDs the searchTagIDs to set + */ + public void setSearchTagIDs(String searchTagIDs) { + this.searchTagIDs = searchTagIDs; + } + protected List searchTagIdCollection = new ArrayList(); protected ObjectMapper mapper = new ObjectMapper(); diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntity.java b/src/main/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntity.java index 4f6188d..ffe92cf 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntity.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/entity/SuggestionSearchEntity.java @@ -42,6 +42,77 @@ public class SuggestionSearchEntity extends IndexableEntity implements IndexDocu private String entityType; private List suggestionConnectorWords = new ArrayList(); private List suggestionAttributeTypes = new ArrayList(); + /** + * @return the suggestionAttributeTypes + */ + public List getSuggestionAttributeTypes() { + return suggestionAttributeTypes; + } + + /** + * @param suggestionAttributeTypes the suggestionAttributeTypes to set + */ + public void setSuggestionAttributeTypes(List suggestionAttributeTypes) { + this.suggestionAttributeTypes = suggestionAttributeTypes; + } + + /** + * @return the suggestionTypeAliases + */ + public List getSuggestionTypeAliases() { + return suggestionTypeAliases; + } + + /** + * @param suggestionTypeAliases the suggestionTypeAliases to set + */ + public void setSuggestionTypeAliases(List suggestionTypeAliases) { + this.suggestionTypeAliases = suggestionTypeAliases; + } + + /** + * @return the suggestableAttr + */ + public List getSuggestableAttr() { + return suggestableAttr; + } + + /** + * @param suggestableAttr the suggestableAttr to set + */ + public void setSuggestableAttr(List suggestableAttr) { + this.suggestableAttr = suggestableAttr; + } + + /** + * @return the outputString + */ + public StringBuffer getOutputString() { + return outputString; + } + + /** + * @param outputString the outputString to set + */ + public void setOutputString(StringBuffer outputString) { + this.outputString = outputString; + } + + /** + * @return the mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * @param mapper the mapper to set + */ + public void setMapper(ObjectMapper mapper) { + this.mapper = mapper; + } + + private List suggestionAttributeValues = new ArrayList(); private List suggestionTypeAliases = new ArrayList(); private List suggestionInputPermutations = new ArrayList(); diff --git a/src/main/java/org/onap/aai/sparky/synchronizer/entity/TransactionStorageType.java b/src/main/java/org/onap/aai/sparky/synchronizer/entity/TransactionStorageType.java index 2f0ffa8..7bb131c 100644 --- a/src/main/java/org/onap/aai/sparky/synchronizer/entity/TransactionStorageType.java +++ b/src/main/java/org/onap/aai/sparky/synchronizer/entity/TransactionStorageType.java @@ -30,7 +30,22 @@ public enum TransactionStorageType { "aaiOffline/active-inventory-query"); private Integer index; - private String outputFolder; + + /** + * @param index the index to set + */ + public void setIndex(Integer index) { + this.index = index; + } + + /** + * @param outputFolder the outputFolder to set + */ + public void setOutputFolder(String outputFolder) { + this.outputFolder = outputFolder; + } + +private String outputFolder; /** * Instantiates a new transaction storage type. 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,16 +33,30 @@ 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. * 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 { /** -- cgit 1.2.3-korg