Catalog alignment
[sdc.git] / asdctool / src / test / java / org / openecomp / sdc / asdctool / impl / ArtifactUuidFixTest.java
index 0ea4484..8d599e5 100644 (file)
@@ -20,8 +20,8 @@
 
 package org.openecomp.sdc.asdctool.impl;
 
-import org.janusgraph.core.JanusGraphVertex;
 import fj.data.Either;
+import org.janusgraph.core.JanusGraphVertex;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentMatchers;
@@ -40,16 +40,26 @@ import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
 import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentParametersView;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.GroupInstance;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
 import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade;
-import org.openecomp.sdc.be.resources.data.ESArtifactData;
+import org.openecomp.sdc.be.resources.data.DAOArtifactData;
 import org.openecomp.sdc.common.api.ArtifactTypeEnum;
 import org.openecomp.sdc.common.api.Constants;
 
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.ArrayList;
 
 import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
@@ -185,11 +195,13 @@ public class ArtifactUuidFixTest {
         .getByCriteria(VertexTypeEnum.TOPOLOGY_TEMPLATE, hasProps, hasNotProps, JsonParseFlagEnum.ParseAll)).thenReturn(Either.left(list));
                when(toscaOperationFacade.getToscaElement(ArgumentMatchers.eq(graphVertex.getUniqueId()),any(ComponentParametersView.class)))
                                .thenReturn(Either.left(service));
-               byte[] payload = "value".getBytes();
 
-               ESArtifactData esArtifactData =new ESArtifactData();
-               esArtifactData.setDataAsArray(payload);
-               Either<ESArtifactData, CassandraOperationStatus> artifactfromESres = Either.left(esArtifactData);
+               DAOArtifactData artifactData = new DAOArtifactData();
+               byte[] data = "value".getBytes();
+               ByteBuffer bufferData = ByteBuffer.wrap(data);
+               artifactData.setData(bufferData);
+
+               Either<DAOArtifactData, CassandraOperationStatus> artifactfromESres = Either.left(artifactData);
                when(artifactCassandraDao.getArtifact(anyString())).thenReturn(artifactfromESres);
                result = test.doFix(fixComponent, runMode);
                assertEquals(false, result);