<version>1.2.17</version>
</dependency>
+ <dependency>
+ <groupId>com.openpojo</groupId>
+ <artifactId>openpojo</artifactId>
+ <version>0.8.6</version>
+ </dependency>
+
<dependency>
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-fw</artifactId>
if (sizeAfter > 0) {
- Collection<String> presyncIds = before.getImportedObjectIds();
- presyncIds.removeAll(after.getImportedObjectIds());
+ Collection<String> presyncIds = before.getImportedObjectIdsAsValues();
+ presyncIds.removeAll(after.getImportedObjectIdsAsValues());
try {
LOG.info(AaiUiMsgs.ES_SYNC_SELECTIVE_DELETE, indexName, indexType,
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;
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);
}
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
return rootNode.toString();
}
- @Override
+ /**
+ * @return the attributes
+ */
+ public Map<String, String> getAttributes() {
+ return attributes;
+ }
+
+ /**
+ * @param attributes the attributes to set
+ */
+ public void setAttributes(Map<String, String> 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;
public class AggregationSuggestionEntity extends IndexableEntity implements IndexDocument {
private List<String> inputs = new ArrayList<String>();
+ /**
+ * @return the inputs
+ */
+ public List<String> getInputs() {
+ return inputs;
+ }
+
+ /**
+ * @param inputs the inputs to set
+ */
+ public void setInputs(List<String> 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();
public class IndexableCrossEntityReference extends IndexableEntity implements IndexDocument {
protected String crossReferenceEntityValues;
- protected ArrayList<String> crossEntityReferenceCollection = new ArrayList<String>();
+ /**
+ * @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<String> getCrossEntityReferenceCollection() {
+ return crossEntityReferenceCollection;
+ }
+
+ /**
+ * @param crossEntityReferenceCollection the crossEntityReferenceCollection to set
+ */
+ public void setCrossEntityReferenceCollection(ArrayList<String> 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<String> crossEntityReferenceCollection = new ArrayList<String>();
protected ObjectMapper mapper = new ObjectMapper();
/**
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";
private Map<String, String> other = new HashMap<String, String>();
/**
+ * @param other the other to set
+ */
+public void setOther(Map<String, String> other) {
+ this.other = other;
+}
+
+/**
* Any.
*
* @return the map
return other;
}
- /**
+ public Map<String, String> getOther() {
+ return other;
+}
+
+/**
* Sets the.
*
* @param name the name
protected ConcurrentHashMap<String, String> importedObjectIds =
new ConcurrentHashMap<String, String>();
- public Collection<String> getImportedObjectIds() {
- return importedObjectIds.values();
- }
+ /**
+ * @return the importedObjectIds
+ */
+ public ConcurrentHashMap<String, String> getImportedObjectIds() {
+ return importedObjectIds;
+ }
+
+ /**
+ * @param importedObjectIds
+ * the importedObjectIds to set
+ */
+ public void setImportedObjectIds(ConcurrentHashMap<String, String> importedObjectIds) {
+ this.importedObjectIds = importedObjectIds;
+ }
+
+ public Collection<String> getImportedObjectIdsAsValues() {
+ return importedObjectIds.values();
+ }
/**
* Adds the object id.
*/
public class SearchableEntity extends IndexableEntity implements IndexDocument {
protected List<String> searchTagCollection = new ArrayList<String>();
+ /**
+ * @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<String> searchTagCollection) {
+ this.searchTagCollection = searchTagCollection;
+ }
+
+ /**
+ * @param searchTagIdCollection the searchTagIdCollection to set
+ */
+ public void setSearchTagIdCollection(List<String> 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<String> searchTagIdCollection = new ArrayList<String>();
protected ObjectMapper mapper = new ObjectMapper();
private String entityType;
private List<String> suggestionConnectorWords = new ArrayList<String>();
private List<String> suggestionAttributeTypes = new ArrayList<String>();
+ /**
+ * @return the suggestionAttributeTypes
+ */
+ public List<String> getSuggestionAttributeTypes() {
+ return suggestionAttributeTypes;
+ }
+
+ /**
+ * @param suggestionAttributeTypes the suggestionAttributeTypes to set
+ */
+ public void setSuggestionAttributeTypes(List<String> suggestionAttributeTypes) {
+ this.suggestionAttributeTypes = suggestionAttributeTypes;
+ }
+
+ /**
+ * @return the suggestionTypeAliases
+ */
+ public List<String> getSuggestionTypeAliases() {
+ return suggestionTypeAliases;
+ }
+
+ /**
+ * @param suggestionTypeAliases the suggestionTypeAliases to set
+ */
+ public void setSuggestionTypeAliases(List<String> suggestionTypeAliases) {
+ this.suggestionTypeAliases = suggestionTypeAliases;
+ }
+
+ /**
+ * @return the suggestableAttr
+ */
+ public List<String> getSuggestableAttr() {
+ return suggestableAttr;
+ }
+
+ /**
+ * @param suggestableAttr the suggestableAttr to set
+ */
+ public void setSuggestableAttr(List<String> 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<String> suggestionAttributeValues = new ArrayList<String>();
private List<String> suggestionTypeAliases = new ArrayList<String>();
private List<String> suggestionInputPermutations = new ArrayList<String>();
"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.
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.
*
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();
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;
/**
* The Class RestfulDataAccessorTest.
*/
-@RunWith(PowerMockRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class RestfulDataAccessorTest {
private RestClientBuilder clientBuilderMock;
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 {
/**
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;
/**
* The Class IndexDocumentTest.
*/
-@RunWith(PowerMockRunner.class)
+@RunWith(MockitoJUnitRunner.class)
public class IndexDocumentTest {
private LogValidator logValidator;
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 {
--- /dev/null
+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);
+ }
+}
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 {
/**
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 {
/**