diff --git a/services/activity-spec/activity-spec-init/pom.xml b/services/activity-spec/activity-spec-init/pom.xml
index 7873876..2d41c9e 100644
--- a/services/activity-spec/activity-spec-init/pom.xml
+++ b/services/activity-spec/activity-spec-init/pom.xml
@@ -8,7 +8,7 @@
     <packaging>pom</packaging>
 
     <parent>
-        <groupId>org.openecomp.activityspec</groupId>
+        <groupId>org.onap.sdc.activityspec</groupId>
         <artifactId>activity-spec</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
diff --git a/services/activity-spec/activity-spec-web/activity-spec-api-docs/pom.xml b/services/activity-spec/activity-spec-web/activity-spec-api-docs/pom.xml
index b920b91..3927047 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-api-docs/pom.xml
+++ b/services/activity-spec/activity-spec-web/activity-spec-api-docs/pom.xml
@@ -8,7 +8,7 @@
     <packaging>pom</packaging>
 
     <parent>
-        <groupId>org.openecomp.activityspec</groupId>
+        <groupId>org.onap.sdc.activityspec</groupId>
         <artifactId>activity-spec</artifactId>
         <version>1.2.0-SNAPSHOT</version>
         <relativePath>../..</relativePath>
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/pom.xml b/services/activity-spec/activity-spec-web/activity-spec-service/pom.xml
index 12bb3ca..49cb3f4 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/pom.xml
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/pom.xml
@@ -7,7 +7,7 @@
     <artifactId>activity-spec-service</artifactId>
 
     <parent>
-        <groupId>org.openecomp.activityspec</groupId>
+        <groupId>org.onap.sdc.activityspec</groupId>
         <artifactId>activity-spec</artifactId>
         <version>1.2.0-SNAPSHOT</version>
         <relativePath>../..</relativePath>
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/ActivitySpecs.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/ActivitySpecs.java
new file mode 100644
index 0000000..06b8524
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/ActivitySpecs.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.rest;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecActionRequestDto;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecRequestDto;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.Valid;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+@Path("/v1.0/activity-spec/")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@Api(value = "Activity Specs")
+@Validated
+public interface ActivitySpecs {
+
+    @POST
+    @Path("/")
+    @ApiOperation(value = "Create Activity Spec")
+    Response createActivitySpec(@Valid ActivitySpecRequestDto request);
+
+    @GET
+    @Path("/{id}/versions/{versionId}")
+    @ApiOperation(value = "Get Activity Spec")
+    Response getActivitySpec(@ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
+                                    @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
+
+    @PUT
+    @Path("/{id}/versions/{versionId}")
+    @ApiOperation(value = "Update Activity Spec")
+    Response updateActivitySpec(@Valid ActivitySpecRequestDto request,
+                                       @ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
+                                       @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
+
+    @PUT
+    @Path("/{id}/versions/{versionId}/actions")
+    @ApiOperation(value = "Actions on a activity spec",
+            notes = "Performs one of the following actions on a activity spec: |" + "CERTIFY: Certifies activity spec.|"
+                            + "DEPRECATE: Deprecates activity spec.|" + "DELETE: Deletes activity spec.")
+    Response actOnActivitySpec(ActivitySpecActionRequestDto request,
+                                      @ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
+                                      @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
+
+    @GET
+    @Path("/")
+    @ApiOperation(value = "Get list of activity specs ", responseContainer = "List")
+    Response list(@ApiParam(value = "List activity specs based on status filter") @QueryParam("status")
+                          String versionStatus);
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivityParameterToDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivityParameterToDto.java
similarity index 60%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivityParameterToDto.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivityParameterToDto.java
index bd644ff..acf3ef4 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivityParameterToDto.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivityParameterToDto.java
@@ -14,18 +14,18 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.mapping;
+package org.onap.sdc.activityspec.api.rest.mapping;
 
-import org.openecomp.activityspec.be.datatypes.ActivitySpecParameter;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecParameterDto;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecParameterDto;
+import org.onap.sdc.activityspec.be.datatypes.ActivitySpecParameter;
 import org.openecomp.sdcrests.mapping.MappingBase;
 
-public class MapActivityParameterToDto extends MappingBase<ActivitySpecParameter,
-    ActivitySpecParameterDto> {
-  @Override
-  public void doMapping(ActivitySpecParameter source, ActivitySpecParameterDto target) {
-    target.setName(source.getName());
-    target.setType(source.getType());
-    target.setValue(source.getValue());
-  }
+public class MapActivityParameterToDto extends MappingBase<ActivitySpecParameter, ActivitySpecParameterDto> {
+
+    @Override
+    public void doMapping(ActivitySpecParameter source, ActivitySpecParameterDto target) {
+        target.setName(source.getName());
+        target.setType(source.getType());
+        target.setValue(source.getValue());
+    }
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java
new file mode 100644
index 0000000..aedb4ed
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.rest.mapping;
+
+import java.util.ArrayList;
+
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecRequestDto;
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
+import org.onap.sdc.activityspec.be.datatypes.ActivitySpecParameter;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+public class MapActivitySpecRequestDtoToActivitySpecEntity
+        extends MappingBase<ActivitySpecRequestDto, ActivitySpecEntity> {
+
+    @Override
+    public void doMapping(ActivitySpecRequestDto source, ActivitySpecEntity target) {
+        target.setName(source.getName());
+        target.setDescription(source.getDescription());
+        target.setCategoryList(source.getCategoryList() == null ? new ArrayList<>() : source.getCategoryList());
+        if (Objects.nonNull(source.getInputs())) {
+            target.setInputs(source.getInputs().stream().map(activitySpecParameterDto -> new MapDtoToActivityParameter()
+                                                                                       .applyMapping(
+                                                                                          activitySpecParameterDto,
+                                                                                          ActivitySpecParameter.class))
+                                   .collect(Collectors.toList()));
+        }
+        if (Objects.nonNull(source.getOutputs())) {
+            target.setOutputs(source.getOutputs().stream()
+                                    .map(activitySpecParameterDto -> new MapDtoToActivityParameter()
+                                                                             .applyMapping(activitySpecParameterDto,
+                                                                                     ActivitySpecParameter.class))
+                                    .collect(Collectors.toList()));
+        }
+        target.setType(source.getType());
+        target.setContent(source.getContent());
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecCreateResponse.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecCreateResponse.java
new file mode 100644
index 0000000..0568ef1
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecCreateResponse.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.rest.mapping;
+
+import java.util.Objects;
+
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecCreateResponse;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapActivitySpecToActivitySpecCreateResponse
+        extends MappingBase<ActivitySpecEntity, ActivitySpecCreateResponse> {
+
+    @Override
+    public void doMapping(ActivitySpecEntity source, ActivitySpecCreateResponse target) {
+        target.setId(source.getId());
+        target.setVersionId(Objects.nonNull(source.getVersion()) ? source.getVersion().getId() : null);
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java
new file mode 100644
index 0000000..fb4fb18
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.rest.mapping;
+
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecParameterDto;
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecGetResponse;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+public class MapActivitySpecToActivitySpecGetResponse extends MappingBase<ActivitySpecEntity, ActivitySpecGetResponse> {
+
+    @Override
+    public void doMapping(ActivitySpecEntity source, ActivitySpecGetResponse target) {
+        target.setName(source.getName());
+        target.setDescription(source.getDescription());
+        target.setCategoryList(source.getCategoryList());
+        if (Objects.nonNull(source.getInputs())) {
+            target.setInputs(source.getInputs().stream().map(activitySpecParameter -> new MapActivityParameterToDto()
+                                                                                       .applyMapping(
+                                                                                        activitySpecParameter,
+                                                                                       ActivitySpecParameterDto.class))
+                                   .collect(Collectors.toList()));
+        }
+        if (Objects.nonNull(source.getOutputs())) {
+            target.setOutputs(source.getOutputs().stream().map(activitySpecParameter -> new MapActivityParameterToDto()
+                                                                                                .applyMapping(
+                                                                                                activitySpecParameter,
+                                                                                        ActivitySpecParameterDto.class))
+                                    .collect(Collectors.toList()));
+        }
+        target.setStatus(source.getStatus());
+        target.setType(source.getType());
+        target.setContent(source.getContent());
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapDtoToActivityParameter.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapDtoToActivityParameter.java
new file mode 100644
index 0000000..051cbbd
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapDtoToActivityParameter.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.rest.mapping;
+
+import org.onap.sdc.activityspec.be.datatypes.ActivitySpecParameter;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecParameterDto;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+public class MapDtoToActivityParameter extends MappingBase<ActivitySpecParameterDto, ActivitySpecParameter> {
+
+    @Override
+    public void doMapping(ActivitySpecParameterDto source, ActivitySpecParameter target) {
+        target.setName(source.getName());
+        target.setType(source.getType());
+        target.setValue(source.getValue());
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapItemToListResponseDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapItemToListResponseDto.java
new file mode 100644
index 0000000..2671c97
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/mapping/MapItemToListResponseDto.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.rest.mapping;
+
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecListResponseDto;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
+import org.openecomp.sdcrests.mapping.MappingBase;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+import static org.onap.sdc.activityspec.utils.ActivitySpecConstant.CATEGORY_ATTRIBUTE_NAME;
+
+public class MapItemToListResponseDto extends MappingBase<Item, ActivitySpecListResponseDto> {
+
+    @Override
+    public void doMapping(Item source, ActivitySpecListResponseDto target) {
+        target.setId(source.getId());
+        target.setName(source.getName());
+        target.setCategoryList((List<String>) source.getProperties().get(CATEGORY_ATTRIBUTE_NAME));
+        final Map<VersionStatus, Integer> versionStatusCounters = source.getVersionStatusCounters();
+        if (Objects.nonNull(versionStatusCounters) && !versionStatusCounters.isEmpty()) {
+            final Set<VersionStatus> versionStatuses = versionStatusCounters.keySet();
+            target.setStatus(versionStatuses.stream().findFirst().isPresent()
+                                     ? versionStatuses.stream().findFirst().get().name() : null);
+        }
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/services/ActivitySpecsImpl.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/services/ActivitySpecsImpl.java
new file mode 100644
index 0000000..e0eec80
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/services/ActivitySpecsImpl.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.rest.services;
+
+import org.onap.sdc.activityspec.api.rest.ActivitySpecs;
+import org.onap.sdc.activityspec.api.rest.mapping.MapActivitySpecRequestDtoToActivitySpecEntity;
+import org.onap.sdc.activityspec.api.rest.mapping.MapActivitySpecToActivitySpecCreateResponse;
+import org.onap.sdc.activityspec.api.rest.mapping.MapActivitySpecToActivitySpecGetResponse;
+import org.onap.sdc.activityspec.api.rest.mapping.MapItemToListResponseDto;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecActionRequestDto;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecGetResponse;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecListResponseDto;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecRequestDto;
+import org.onap.sdc.activityspec.api.rest.types.InternalEmptyObject;
+import org.onap.sdc.activityspec.be.ActivitySpecManager;
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
+import org.onap.sdc.activityspec.be.impl.ActivitySpecManagerImpl;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecCreateResponse;
+import org.onap.sdc.activityspec.be.dao.impl.ActivitySpecDaoZusammenImpl;
+import org.openecomp.core.dao.UniqueValueDaoFactory;
+import org.openecomp.core.zusammen.api.ZusammenAdaptorFactory;
+import org.openecomp.sdc.versioning.ItemManagerFactory;
+import org.openecomp.sdc.versioning.VersioningManagerFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.ws.rs.core.Response;
+
+@Service("activitySpecs")
+@Validated
+public class ActivitySpecsImpl implements ActivitySpecs {
+
+
+    private final ActivitySpecManager activitySpecManager =
+            new ActivitySpecManagerImpl(ItemManagerFactory.getInstance().createInterface(),
+                                               VersioningManagerFactory.getInstance().createInterface(),
+                                               new ActivitySpecDaoZusammenImpl(ZusammenAdaptorFactory.getInstance()
+                                                                                                .createInterface()),
+                                               UniqueValueDaoFactory.getInstance().createInterface());
+
+    @Override
+    public Response createActivitySpec(ActivitySpecRequestDto request) {
+        ActivitySpecEntity activitySpec =
+                new MapActivitySpecRequestDtoToActivitySpecEntity().applyMapping(request, ActivitySpecEntity.class);
+
+        activitySpec = activitySpecManager.createActivitySpec(activitySpec);
+        ActivitySpecCreateResponse createActivitySpecResponse = new MapActivitySpecToActivitySpecCreateResponse()
+                                                                        .applyMapping(activitySpec,
+                                                                                ActivitySpecCreateResponse.class);
+
+        return Response.ok(createActivitySpecResponse).build();
+    }
+
+    @Override
+    public Response getActivitySpec(String activitySpecId, String versionId) {
+        ActivitySpecEntity activitySpec = new ActivitySpecEntity();
+        activitySpec.setId(activitySpecId);
+        activitySpec.setVersion(new Version(versionId));
+        final ActivitySpecEntity retrieved = activitySpecManager.get(activitySpec);
+        ActivitySpecGetResponse getResponse =
+                new MapActivitySpecToActivitySpecGetResponse().applyMapping(retrieved, ActivitySpecGetResponse.class);
+        return Response.ok(getResponse).build();
+    }
+
+    @Override
+    public Response updateActivitySpec(ActivitySpecRequestDto request, String activitySpecId, String versionId) {
+        ActivitySpecEntity activitySpec =
+                new MapActivitySpecRequestDtoToActivitySpecEntity().applyMapping(request, ActivitySpecEntity.class);
+
+        activitySpec.setId(activitySpecId);
+        activitySpec.setVersion(new Version(versionId));
+
+        activitySpecManager.update(activitySpec);
+
+        return Response.ok(new InternalEmptyObject()).build();
+    }
+
+    @Override
+    public Response actOnActivitySpec(ActivitySpecActionRequestDto request, String activitySpecId, String versionId) {
+        activitySpecManager.actOnAction(activitySpecId, versionId, request.getAction());
+        return Response.ok(new InternalEmptyObject()).build();
+    }
+
+    @Override
+    public Response list(String versionStatus) {
+
+        GenericCollectionWrapper<ActivitySpecListResponseDto> results = new GenericCollectionWrapper<>();
+        MapItemToListResponseDto mapper = new MapItemToListResponseDto();
+        activitySpecManager.list(versionStatus).stream()
+                           .sorted((o1, o2) -> o2.getModificationTime().compareTo(o1.getModificationTime())).forEach(
+                activitySpecItem -> results.add(
+                        mapper.applyMapping(activitySpecItem, ActivitySpecListResponseDto.class)));
+
+        return Response.ok(results).build();
+    }
+
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecAction.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecAction.java
similarity index 88%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecAction.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecAction.java
index bedcfcb..c3e6904 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecAction.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecAction.java
@@ -14,10 +14,8 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.types;
+package org.onap.sdc.activityspec.api.rest.types;
 
 public enum ActivitySpecAction {
-  CERTIFY,
-  DEPRECATE,
-  DELETE
+    CERTIFY, DEPRECATE, DELETE
 }
\ No newline at end of file
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecActionRequestDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecActionRequestDto.java
similarity index 88%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecActionRequestDto.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecActionRequestDto.java
index c901212..a420e1f 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecActionRequestDto.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecActionRequestDto.java
@@ -14,9 +14,10 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.types;
+package org.onap.sdc.activityspec.api.rest.types;
 
 @lombok.Data
 public class ActivitySpecActionRequestDto {
-  private ActivitySpecAction action;
+
+    private ActivitySpecAction action;
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecCreateResponse.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecCreateResponse.java
similarity index 86%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecCreateResponse.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecCreateResponse.java
index 9a654f7..d21dab1 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecCreateResponse.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecCreateResponse.java
@@ -14,11 +14,12 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.types;
+package org.onap.sdc.activityspec.api.rest.types;
 
 @lombok.Data
 public class ActivitySpecCreateResponse {
-  private String id;
-  private String versionId;
+
+    private String id;
+    private String versionId;
 }
 
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecGetResponse.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecGetResponse.java
similarity index 64%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecGetResponse.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecGetResponse.java
index 9453935..04cdc4e 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecGetResponse.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecGetResponse.java
@@ -14,18 +14,19 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.types;
+package org.onap.sdc.activityspec.api.rest.types;
 
 import java.util.List;
 
 @lombok.Data
-public class ActivitySpecGetResponse  {
-  private String name;
-  private String description;
-  private List<String> categoryList;
-  private List<ActivitySpecParameterDto> inputs;
-  private List<ActivitySpecParameterDto> outputs;
-  private String status;
-  private String type;
-  private String content;
+public class ActivitySpecGetResponse {
+
+    private String name;
+    private String description;
+    private List<String> categoryList;
+    private List<ActivitySpecParameterDto> inputs;
+    private List<ActivitySpecParameterDto> outputs;
+    private String status;
+    private String type;
+    private String content;
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecListResponseDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecListResponseDto.java
similarity index 79%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecListResponseDto.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecListResponseDto.java
index 782143f..4c6128f 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecListResponseDto.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecListResponseDto.java
@@ -14,15 +14,16 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.types;
+package org.onap.sdc.activityspec.api.rest.types;
 
 import java.util.List;
 
 @lombok.Data
 public class ActivitySpecListResponseDto {
-  private String id;
-  private String version;
-  String name;
-  List<String> categoryList;
-  private String status;
+
+    private String id;
+    private String version;
+    String name;
+    List<String> categoryList;
+    private String status;
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecParameterDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecParameterDto.java
similarity index 83%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecParameterDto.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecParameterDto.java
index 76e8262..69a66ce 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecParameterDto.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecParameterDto.java
@@ -14,11 +14,12 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.types;
+package org.onap.sdc.activityspec.api.rest.types;
 
 @lombok.Data
 public class ActivitySpecParameterDto {
-  private String name;
-  private String type;
-  private String value;
+
+    private String name;
+    private String type;
+    private String value;
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecRequestDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecRequestDto.java
new file mode 100644
index 0000000..86148ac
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/ActivitySpecRequestDto.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.rest.types;
+
+import io.swagger.annotations.ApiModel;
+import org.hibernate.validator.constraints.NotBlank;
+
+import javax.validation.constraints.Pattern;
+import java.util.List;
+
+@ApiModel(value = "ActivitySpecRequest")
+@lombok.Data
+public class ActivitySpecRequestDto {
+
+    @NotBlank(message = "Mandatory %s field is missing/null")
+    @Pattern(regexp = "^[a-zA-Z0-9-]*$", message = "%s should match with \"^[a-zA-Z0-9-]*$\" pattern")
+    private String name;
+    private String description;
+
+    private List<String> categoryList;
+    private List<ActivitySpecParameterDto> inputs;
+    private List<ActivitySpecParameterDto> outputs;
+    private String type;
+    private String content;
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/InternalEmptyObject.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/InternalEmptyObject.java
similarity index 88%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/InternalEmptyObject.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/InternalEmptyObject.java
index 2faf7bc..9d9538e 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/InternalEmptyObject.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/rest/types/InternalEmptyObject.java
@@ -14,14 +14,14 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.types;
+package org.onap.sdc.activityspec.api.rest.types;
 
 import org.codehaus.jackson.annotate.JsonAutoDetect;
 
 /**
- * Object of this class can be used to create empty Response body like "{}"
+ * Object of this class can be used to create empty Response body like "{}".
  */
 @JsonAutoDetect
-public class InternalEmptyObject  {
+public class InternalEmptyObject {
 
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/server/filters/ActivitySpecSessionContextFilter.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/server/filters/ActivitySpecSessionContextFilter.java
new file mode 100644
index 0000000..9269eac
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/server/filters/ActivitySpecSessionContextFilter.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.server.filters;
+
+import java.io.IOException;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response.Status;
+
+import org.apache.commons.lang.StringUtils;
+import org.onap.sdc.activityspec.utils.ActivitySpecConstant;
+import org.openecomp.sdc.common.session.SessionContextProvider;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+
+public class ActivitySpecSessionContextFilter implements Filter {
+
+    private static final String MESSAGE_USER_MAY_NOT_BE_NULL = "{\"message\": \"User ID can not be null\"}";
+
+    @Override
+    public void init(FilterConfig filterConfig) {
+        //No ActivitySpec specific initialization required
+    }
+
+    @Override
+    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
+            throws IOException, ServletException {
+
+        final String userHeader =
+                ((HttpServletRequest) servletRequest).getHeader(ActivitySpecConstant.USER_ID_HEADER_PARAM);
+
+        // Not a real security, just make sure the request
+        // has passed some authentication gateway
+        if (StringUtils.isEmpty(userHeader)) {
+            sendErrorResponse(servletResponse);
+            return;
+        }
+
+        SessionContextProvider contextProvider = SessionContextProviderFactory.getInstance().createInterface();
+
+        try {
+            // use the system-wide user and tenant
+            contextProvider.create(ActivitySpecConstant.USER, ActivitySpecConstant.TENANT);
+            filterChain.doFilter(servletRequest, servletResponse);
+        } finally {
+            contextProvider.close();
+        }
+    }
+
+    private void sendErrorResponse(ServletResponse servletResponse) throws IOException {
+        HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
+        httpServletResponse.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
+        httpServletResponse.setStatus(Status.UNAUTHORIZED.getStatusCode());
+        servletResponse.getOutputStream().write(MESSAGE_USER_MAY_NOT_BE_NULL.getBytes());
+    }
+
+    @Override
+    public void destroy() {
+        //No ActivitySpec specific destroy required
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/server/listeners/ActivitySpecAppStartupListener.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/server/listeners/ActivitySpecAppStartupListener.java
new file mode 100644
index 0000000..cb1cc65
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/api/server/listeners/ActivitySpecAppStartupListener.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.api.server.listeners;
+
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.springframework.web.context.ContextLoaderListener;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import static org.onap.sdc.activityspec.utils.ActivitySpecConstant.TENANT;
+import static org.onap.sdc.activityspec.utils.ActivitySpecConstant.USER;
+
+public class ActivitySpecAppStartupListener implements ServletContextListener {
+
+    private ContextLoaderListener springListener;
+
+    @Override
+    public void contextInitialized(ServletContextEvent servletContextEvent) {
+        SessionContextProviderFactory.getInstance().createInterface().create(USER, TENANT);
+        springListener = new ContextLoaderListener();
+        springListener.initWebApplicationContext(servletContextEvent.getServletContext());
+    }
+
+    @Override
+    public void contextDestroyed(ServletContextEvent servletContextEvent) {
+        springListener.closeWebApplicationContext(servletContextEvent.getServletContext());
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/ActivitySpecManager.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/ActivitySpecManager.java
new file mode 100644
index 0000000..6c1a4d0
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/ActivitySpecManager.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.be;
+
+import java.util.Collection;
+
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecAction;
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
+import org.openecomp.sdc.versioning.types.Item;
+
+public interface ActivitySpecManager {
+
+    ActivitySpecEntity createActivitySpec(ActivitySpecEntity activitySpecEntity);
+
+    ActivitySpecEntity get(ActivitySpecEntity activitySpec);
+
+    void update(ActivitySpecEntity activitySpec);
+
+    void actOnAction(String activitySpecId, String versionId, ActivitySpecAction action);
+
+    Collection<Item> list(String versionStatus);
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecListResponseDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/dao/ActivitySpecDao.java
similarity index 66%
copy from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecListResponseDto.java
copy to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/dao/ActivitySpecDao.java
index 782143f..c71f296 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecListResponseDto.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/dao/ActivitySpecDao.java
@@ -14,15 +14,15 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.types;
+package org.onap.sdc.activityspec.be.dao;
 
-import java.util.List;
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
 
-@lombok.Data
-public class ActivitySpecListResponseDto {
-  private String id;
-  private String version;
-  String name;
-  List<String> categoryList;
-  private String status;
+public interface ActivitySpecDao {
+
+    void create(ActivitySpecEntity activitySpecEntity);
+
+    ActivitySpecEntity get(ActivitySpecEntity activitySpec);
+
+    void update(ActivitySpecEntity activitySpec);
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java
new file mode 100644
index 0000000..9da4cd4
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.be.dao.impl;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.Info;
+
+import org.onap.sdc.activityspec.be.dao.ActivitySpecDao;
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
+import org.onap.sdc.activityspec.be.datatypes.ActivitySpecData;
+import org.onap.sdc.activityspec.be.datatypes.ElementType;
+import org.onap.sdc.activityspec.utils.ActivitySpecConstant;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.core.zusammen.api.ZusammenAdaptor;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Objects;
+import java.util.Optional;
+
+import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
+public class ActivitySpecDaoZusammenImpl implements ActivitySpecDao {
+
+    private final ZusammenAdaptor zusammenAdaptor;
+
+    public ActivitySpecDaoZusammenImpl(ZusammenAdaptor zusammenAdaptor) {
+        this.zusammenAdaptor = zusammenAdaptor;
+    }
+
+    @Override
+    public void create(ActivitySpecEntity entity) {
+        SessionContext context = createSessionContext();
+        ZusammenElement generalElement = mapActivityDetailsToZusammenElement(entity, Action.CREATE);
+
+        ElementContext elementContext = new ElementContext(entity.getId(), entity.getVersion().getId());
+        zusammenAdaptor
+                .saveElement(context, elementContext, generalElement, "Create Activity Spec General Info Element");
+    }
+
+    @Override
+    public ActivitySpecEntity get(ActivitySpecEntity entity) {
+        SessionContext context = createSessionContext();
+
+        ElementContext elementContext = new ElementContext(entity.getId(), entity.getVersion().getId());
+        Optional<Element> element =
+                zusammenAdaptor.getElementByName(context, elementContext, null, ElementType.ACTIVITYSPEC.name());
+        if (element.isPresent()) {
+            return mapZusammenElementToActivityDetails(element.get());
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public void update(ActivitySpecEntity entity) {
+        SessionContext context = createSessionContext();
+        ZusammenElement generalElement = mapActivityDetailsToZusammenElement(entity, Action.UPDATE);
+
+        ElementContext elementContext = new ElementContext(entity.getId(), entity.getVersion().getId());
+        zusammenAdaptor
+                .saveElement(context, elementContext, generalElement, "Update Activity Spec General Info Element");
+    }
+
+
+    private ActivitySpecEntity mapZusammenElementToActivityDetails(Element element) {
+        ActivitySpecEntity entity = new ActivitySpecEntity();
+        entity.setId(element.getElementId().getValue());
+        enrichEntityFromElementData(entity, element.getData());
+        enrichEntityFromElementInfo(entity, element.getInfo());
+        return entity;
+    }
+
+    private ZusammenElement mapActivityDetailsToZusammenElement(ActivitySpecEntity entity, Action action) {
+        ZusammenElement generalElement = buildStructuralElement(ElementType.ACTIVITYSPEC.name(), action);
+
+        enrichElementInfoFromEntity(generalElement, entity);
+        enrichElementDataFromEntity(generalElement, entity);
+        return generalElement;
+    }
+
+
+    private void enrichEntityFromElementInfo(ActivitySpecEntity entity, Info info) {
+        entity.setName(info.getProperty(InfoPropertyName.NAME.getValue()));
+        entity.setDescription(info.getProperty(InfoPropertyName.DESCRIPTION.getValue()));
+        entity.setCategoryList(info.getProperty(InfoPropertyName.CATEGORY.getValue()));
+    }
+
+    private void enrichEntityFromElementData(ActivitySpecEntity entity, InputStream data) {
+        ActivitySpecData activitySpecData = JsonUtil.json2Object(data, ActivitySpecData.class);
+        if (Objects.nonNull(activitySpecData)) {
+            entity.setInputs(activitySpecData.getInputs());
+            entity.setOutputs(activitySpecData.getOutputs());
+            entity.setType(activitySpecData.getType());
+            entity.setContent(activitySpecData.getContent());
+        }
+    }
+
+    private void enrichElementInfoFromEntity(ZusammenElement element, ActivitySpecEntity entity) {
+        element.getInfo().addProperty(InfoPropertyName.DESCRIPTION.getValue(), entity.getDescription());
+        element.getInfo().addProperty(InfoPropertyName.NAME.getValue(), entity.getName());
+        element.getInfo().addProperty(InfoPropertyName.CATEGORY.getValue(), entity.getCategoryList());
+    }
+
+
+    private void enrichElementDataFromEntity(ZusammenElement element, ActivitySpecEntity entity) {
+        ActivitySpecData activitySpecData = new ActivitySpecData();
+        activitySpecData.setInputs(entity.getInputs());
+        activitySpecData.setOutputs(entity.getOutputs());
+        activitySpecData.setType(entity.getType());
+        activitySpecData.setContent(entity.getContent());
+        element.setData(new ByteArrayInputStream(JsonUtil.object2Json(activitySpecData).getBytes()));
+    }
+
+    public enum InfoPropertyName {
+        DESCRIPTION("description"), NAME("name"), CATEGORY(ActivitySpecConstant.CATEGORY_ATTRIBUTE_NAME);
+
+        private final String value;
+
+        InfoPropertyName(String value) {
+            this.value = value;
+        }
+
+        public String getValue() {
+            return value;
+        }
+    }
+
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/dao/types/ActivitySpecEntity.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/dao/types/ActivitySpecEntity.java
new file mode 100644
index 0000000..7dc6612
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/dao/types/ActivitySpecEntity.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.be.dao.types;
+
+import org.onap.sdc.activityspec.be.datatypes.ActivitySpecParameter;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.List;
+
+@lombok.Data
+public class ActivitySpecEntity {
+
+    private String id;
+    private Version version;
+    private String name;
+    private String description;
+
+    private List<String> categoryList;
+    private List<ActivitySpecParameter> inputs;
+    private List<ActivitySpecParameter> outputs;
+    private String type;
+    private String content;
+
+    //Not to be maintained in activityspec element
+    private String status;
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecData.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ActivitySpecData.java
similarity index 74%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecData.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ActivitySpecData.java
index ad70376..2c76ed8 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecData.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ActivitySpecData.java
@@ -14,16 +14,17 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.be.datatypes;
+package org.onap.sdc.activityspec.be.datatypes;
 
 import java.util.Collections;
 import java.util.List;
 
 @lombok.Data
 public class ActivitySpecData {
-  private List<ActivitySpecParameter> inputs = Collections.emptyList();
-  private List<ActivitySpecParameter> outputs = Collections.emptyList();
-  private String type;
-  private String content;
+
+    private List<ActivitySpecParameter> inputs = Collections.emptyList();
+    private List<ActivitySpecParameter> outputs = Collections.emptyList();
+    private String type;
+    private String content;
 }
 
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecParameter.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ActivitySpecParameter.java
similarity index 63%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecParameter.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ActivitySpecParameter.java
index b9153fa..72273dd 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ActivitySpecParameter.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ActivitySpecParameter.java
@@ -14,21 +14,22 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.be.datatypes;
+package org.onap.sdc.activityspec.be.datatypes;
 
 @lombok.Data
 public class ActivitySpecParameter {
-  private String name;
-  private String type;
-  private String value;
 
-  @SuppressWarnings("unused")
-  public ActivitySpecParameter() {
-    // default constructor for automatic tools that use reflection
-  }
+    private String name;
+    private String type;
+    private String value;
 
-  public ActivitySpecParameter(String name, String type) {
-    this.name = name;
-    this.type = type;
-  }
+    @SuppressWarnings("unused")
+    public ActivitySpecParameter() {
+        // default constructor for automatic tools that use reflection
+    }
+
+    public ActivitySpecParameter(String name, String type) {
+        this.name = name;
+        this.type = type;
+    }
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ElementType.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ElementType.java
similarity index 90%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ElementType.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ElementType.java
index be7e61c..d063530 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ElementType.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ElementType.java
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.be.datatypes;
+package org.onap.sdc.activityspec.be.datatypes;
 
 public enum ElementType {
-  ACTIVITYSPEC;
+    ACTIVITYSPEC
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ItemType.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ItemType.java
similarity index 90%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ItemType.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ItemType.java
index 5091412..f9d8fa3 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/datatypes/ItemType.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/datatypes/ItemType.java
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.be.datatypes;
+package org.onap.sdc.activityspec.be.datatypes;
 
 public enum ItemType {
-  ACTIVITYSPEC
+    ACTIVITYSPEC
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/impl/ActivitySpecManagerImpl.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/impl/ActivitySpecManagerImpl.java
new file mode 100644
index 0000000..6853b85
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/be/impl/ActivitySpecManagerImpl.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.be.impl;
+
+import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Certified;
+import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Deleted;
+import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Deprecated;
+import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Draft;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Predicate;
+
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecAction;
+import org.onap.sdc.activityspec.be.dao.ActivitySpecDao;
+import org.onap.sdc.activityspec.utils.ActivitySpecConstant;
+import org.onap.sdc.activityspec.be.ActivitySpecManager;
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
+import org.onap.sdc.activityspec.be.datatypes.ItemType;
+import org.onap.sdc.activityspec.errors.ActivitySpecNotFoundException;
+import org.openecomp.core.dao.UniqueValueDao;
+import org.openecomp.core.util.UniqueValueUtil;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.common.errors.SdcRuntimeException;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
+import org.openecomp.sdc.versioning.types.VersionCreationMethod;
+
+public class ActivitySpecManagerImpl implements ActivitySpecManager {
+
+    private static final Map<VersionStatus, VersionStatus> EXPECTED_PREV_STATUS;
+
+    static {
+        EXPECTED_PREV_STATUS = new EnumMap<>(VersionStatus.class);
+        EXPECTED_PREV_STATUS.put(Certified, Draft);
+        EXPECTED_PREV_STATUS.put(Deprecated, Certified);
+        EXPECTED_PREV_STATUS.put(Deleted, Deprecated);
+    }
+
+    private final ItemManager itemManager;
+    private final VersioningManager versioningManager;
+    private final ActivitySpecDao activitySpecDao;
+    private final UniqueValueUtil uniqueValueUtil;
+    private static final String ACTIVITY_SPEC_NAME = "ActivitySpec.Name";
+    private static final Logger LOGGER = LoggerFactory.getLogger(ActivitySpecManagerImpl.class);
+
+    public ActivitySpecManagerImpl(ItemManager itemManager, VersioningManager versioningManager,
+                                          ActivitySpecDao activitySpecDao, UniqueValueDao uniqueValueDao) {
+        this.itemManager = itemManager;
+        this.versioningManager = versioningManager;
+        this.activitySpecDao = activitySpecDao;
+        this.uniqueValueUtil = new UniqueValueUtil(uniqueValueDao);
+    }
+
+    @Override
+    public ActivitySpecEntity createActivitySpec(ActivitySpecEntity activitySpecEntity) {
+
+        validateUniqueValue(activitySpecEntity);
+
+        Item item = getActivitySpecItem(activitySpecEntity);
+        item = itemManager.create(item);
+
+        Version version = getActivitySpecVersion(activitySpecEntity);
+        versioningManager.create(item.getId(), version, VersionCreationMethod.major);
+
+        enrichActivitySpec(item, version, activitySpecEntity);
+        activitySpecDao.create(activitySpecEntity);
+
+        uniqueValueUtil.createUniqueValue(ACTIVITY_SPEC_NAME, activitySpecEntity.getName());
+        return activitySpecEntity;
+    }
+
+    private void validateUniqueValue(ActivitySpecEntity activitySpecEntity) {
+        try {
+            uniqueValueUtil.validateUniqueValue(ACTIVITY_SPEC_NAME, activitySpecEntity.getName());
+        } catch (CoreException exception) {
+            LOGGER.debug("Unique value error for activity spec name :" + activitySpecEntity.getName(), exception);
+            throw new CoreException(new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION)
+                                                                    .withId(exception.code().id())
+                                                                    .withMessage("name already in use").build());
+        }
+    }
+
+    private Version getActivitySpecVersion(ActivitySpecEntity activitySpecEntity) {
+        return activitySpecEntity.getVersion() == null ? new Version() : activitySpecEntity.getVersion();
+
+    }
+
+    @Override
+    public ActivitySpecEntity get(ActivitySpecEntity activitySpec) {
+        activitySpec.setVersion(calculateLatestVersion(activitySpec.getId(), activitySpec.getVersion()));
+        ActivitySpecEntity retrieved;
+        try {
+            retrieved = activitySpecDao.get(activitySpec);
+        } catch (SdcRuntimeException runtimeException) {
+            LOGGER.debug(
+                    "Failed to retrieve activity spec for activitySpecId: " + activitySpec.getId() + " and version: "
+                            + activitySpec.getVersion().getId(), runtimeException);
+            throw new ActivitySpecNotFoundException(ActivitySpecConstant.ACTIVITY_SPEC_NOT_FOUND, runtimeException);
+        }
+        if (retrieved != null) {
+            final Version retrievedVersion = versioningManager.get(activitySpec.getId(), activitySpec.getVersion());
+            retrieved.setStatus(Objects.nonNull(retrievedVersion) ? retrievedVersion.getStatus().name() : null);
+        }
+        return retrieved;
+    }
+
+    @Override
+    public void update(ActivitySpecEntity activitySpec) {
+
+        ActivitySpecEntity previousActivitySpec = get(activitySpec);
+
+        if (!activitySpec.getName().equals(previousActivitySpec.getName())) {
+            validateUniqueValue(activitySpec);
+        }
+
+        activitySpecDao.update(activitySpec);
+
+        if (!activitySpec.getName().equals(previousActivitySpec.getName())) {
+            uniqueValueUtil.createUniqueValue(ACTIVITY_SPEC_NAME, activitySpec.getName());
+            itemManager.updateName(activitySpec.getId(), activitySpec.getName());
+            uniqueValueUtil.deleteUniqueValue(ACTIVITY_SPEC_NAME, previousActivitySpec.getName());
+        }
+    }
+
+    @Override
+    public void actOnAction(String activitySpecId, String versionId, ActivitySpecAction action) {
+        Version version = new Version(versionId);
+        version = calculateLatestVersion(activitySpecId, version);
+        if (action == ActivitySpecAction.CERTIFY) {
+            version.setStatus(Certified);
+        }
+        if (action == ActivitySpecAction.DEPRECATE) {
+            version.setStatus(Deprecated);
+        }
+        if (action == ActivitySpecAction.DELETE) {
+            version.setStatus(Deleted);
+        }
+
+        updateVersionStatus(activitySpecId, action, version);
+        if (action == ActivitySpecAction.DELETE) {
+            ActivitySpecEntity entity = new ActivitySpecEntity();
+            entity.setId(activitySpecId);
+            entity.setVersion(version);
+            final ActivitySpecEntity activitySpecEntity = get(entity);
+            uniqueValueUtil.deleteUniqueValue(ACTIVITY_SPEC_NAME, activitySpecEntity.getName());
+        }
+    }
+
+    private void updateVersionStatus(String activitySpecId, ActivitySpecAction action, Version version) {
+        VersionStatus prevVersionStatus = null;
+        Version retrievedVersion;
+        try {
+            retrievedVersion = versioningManager.get(activitySpecId, version);
+        } catch (SdcRuntimeException exception) {
+            LOGGER.debug(
+                    "Failed to get version for activitySpecId: " + activitySpecId + " and version: " + version.getId(),
+                    exception);
+            throw new ActivitySpecNotFoundException(ActivitySpecConstant.ACTIVITY_SPEC_NOT_FOUND, exception);
+
+        }
+
+        VersionStatus status = version.getStatus();
+        VersionStatus expectedPrevStatus = EXPECTED_PREV_STATUS.get(status);
+        if (expectedPrevStatus != null) {
+
+            VersionStatus retrievedStatus = Objects.nonNull(retrievedVersion) ? retrievedVersion.getStatus() : null;
+            if (retrievedStatus != expectedPrevStatus) {
+                LOGGER.debug("Failed to " + version.getStatus() + " since activity spec is in " + retrievedStatus);
+                throw new CoreException(new ErrorCode.ErrorCodeBuilder().withMessage(ActivitySpecConstant.INVALID_STATE)
+                                                                        .build());
+            }
+            prevVersionStatus = expectedPrevStatus;
+        }
+
+        if (Objects.nonNull(retrievedVersion)) {
+            retrievedVersion.setStatus(status);
+            versioningManager.updateVersion(activitySpecId, retrievedVersion);
+            itemManager.updateVersionStatus(activitySpecId, status, prevVersionStatus);
+            versioningManager.publish(activitySpecId, retrievedVersion, "actionOnActivitySpec :" + action.name());
+        }
+    }
+
+    private Version calculateLatestVersion(String activitySpecId, Version version) {
+        if (ActivitySpecConstant.VERSION_ID_DEFAULT_VALUE.equalsIgnoreCase(version.getId())) {
+            List<Version> list;
+            try {
+                list = versioningManager.list(activitySpecId);
+            } catch (SdcRuntimeException runtimeException) {
+                LOGGER.debug("Failed to list versions for activitySpecId " + activitySpecId, runtimeException);
+                throw new ActivitySpecNotFoundException(ActivitySpecConstant.ACTIVITY_SPEC_NOT_FOUND, runtimeException);
+            }
+            if (Objects.nonNull(list) && !list.isEmpty()) {
+                return list.get(0);
+            }
+        }
+        return version;
+    }
+
+    @Override
+    public Collection<Item> list(String versionStatus) {
+        Predicate<Item> itemPredicate;
+        if (Objects.nonNull(versionStatus)) {
+
+            VersionStatus statusEnumValue;
+
+            try {
+                statusEnumValue = VersionStatus.valueOf(versionStatus);
+            } catch (IllegalArgumentException e) {
+                LOGGER.debug("Unexpected value of VersionStatus {}", versionStatus);
+                return Collections.emptyList();
+            }
+
+            itemPredicate =
+                    item -> ItemType.ACTIVITYSPEC.name().equals(item.getType()) && item.getVersionStatusCounters()
+                                                                                       .containsKey(statusEnumValue);
+
+        } else {
+            itemPredicate = item -> ItemType.ACTIVITYSPEC.name().equals(item.getType());
+        }
+
+        return itemManager.list(itemPredicate);
+    }
+
+    private void enrichActivitySpec(Item item, Version version, ActivitySpecEntity activitySpecEntity) {
+        activitySpecEntity.setId(item.getId());
+        activitySpecEntity.setVersion(version);
+    }
+
+    private Item getActivitySpecItem(ActivitySpecEntity activitySpecEntity) {
+        Item item = new Item();
+        item.setType(ItemType.ACTIVITYSPEC.name());
+        item.setName(activitySpecEntity.getName());
+        if (activitySpecEntity.getId() != null) {
+            item.setId(activitySpecEntity.getId());
+        }
+        item.addProperty(ActivitySpecConstant.CATEGORY_ATTRIBUTE_NAME, activitySpecEntity.getCategoryList());
+        return item;
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecParameterDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/errors/ActivitySpecErrorResponse.java
similarity index 68%
copy from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecParameterDto.java
copy to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/errors/ActivitySpecErrorResponse.java
index 76e8262..8d9117d 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecParameterDto.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/errors/ActivitySpecErrorResponse.java
@@ -14,11 +14,18 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.api.rest.types;
+package org.onap.sdc.activityspec.errors;
 
 @lombok.Data
-public class ActivitySpecParameterDto {
-  private String name;
-  private String type;
-  private String value;
+public class ActivitySpecErrorResponse {
+
+    private String message;
+
+    public ActivitySpecErrorResponse() {
+        //default constructor
+    }
+
+    public ActivitySpecErrorResponse(String message) {
+        this.message = message;
+    }
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/errors/ActivitySpecNotFoundException.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/errors/ActivitySpecNotFoundException.java
similarity index 81%
rename from services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/errors/ActivitySpecNotFoundException.java
rename to services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/errors/ActivitySpecNotFoundException.java
index 8c775f9..415aa68 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/errors/ActivitySpecNotFoundException.java
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/errors/ActivitySpecNotFoundException.java
@@ -14,11 +14,11 @@
  * limitations under the License.
  */
 
-package org.openecomp.activityspec.errors;
+package org.onap.sdc.activityspec.errors;
 
 public class ActivitySpecNotFoundException extends RuntimeException {
 
-  public ActivitySpecNotFoundException(String message, Throwable cause) {
-    super(message, cause);
-  }
+    public ActivitySpecNotFoundException(String message, Throwable cause) {
+        super(message, cause);
+    }
 }
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/errors/DefaultExceptionMapper.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/errors/DefaultExceptionMapper.java
new file mode 100644
index 0000000..d09d174
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/errors/DefaultExceptionMapper.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.errors;
+
+import java.util.Set;
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.ext.ExceptionMapper;
+
+import org.codehaus.jackson.map.JsonMappingException;
+import org.hibernate.validator.internal.engine.path.PathImpl;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.logging.api.Logger;
+import org.openecomp.sdc.logging.api.LoggerFactory;
+
+public class DefaultExceptionMapper implements ExceptionMapper<Exception> {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultExceptionMapper.class);
+
+    @Override
+    public Response toResponse(Exception exception) {
+        Response response;
+        if (exception instanceof CoreException) {
+            response = transform(CoreException.class.cast(exception));
+        } else if (exception instanceof ActivitySpecNotFoundException) {
+            response = transform(ActivitySpecNotFoundException.class.cast(exception));
+        } else if (exception instanceof ConstraintViolationException) {
+            response = transform(ConstraintViolationException.class.cast(exception));
+        } else if (exception instanceof JsonMappingException) {
+            response = transform(JsonMappingException.class.cast(exception));
+        } else {
+            response = transform(exception);
+        }
+
+        return response;
+    }
+
+    private Response transform(ActivitySpecNotFoundException notFoundException) {
+        LOGGER.error("Transforming ActivitySpecNotFoundException to Error Response  :", notFoundException);
+        return generateResponse(Status.NOT_FOUND, new ActivitySpecErrorResponse(notFoundException.getMessage()));
+    }
+
+    private Response transform(CoreException coreException) {
+        LOGGER.error("Transforming CoreException to Error Response  :", coreException);
+        return generateResponse(Status.BAD_REQUEST, new ActivitySpecErrorResponse(coreException.getMessage()));
+    }
+
+    private Response transform(ConstraintViolationException validationException) {
+        LOGGER.error("Transforming ConstraintViolationException to Error Response :", validationException);
+        Set<ConstraintViolation<?>> constraintViolationSet = validationException.getConstraintViolations();
+        String message;
+
+        String fieldName = null;
+        if (constraintViolationSet != null) {
+            // getting the first violation message for the output response.
+            ConstraintViolation<?> constraintViolation = constraintViolationSet.iterator().next();
+            message = constraintViolation.getMessage();
+            fieldName = ((PathImpl) constraintViolation.getPropertyPath()).getLeafNode().toString();
+
+        } else {
+            message = validationException.getMessage();
+        }
+        return generateResponse(Status.BAD_REQUEST, new ActivitySpecErrorResponse(String.format(message, fieldName)));
+    }
+
+    private Response transform(Exception exception) {
+        LOGGER.error("Transforming Exception to Error Response " + exception);
+        return generateResponse(Status.INTERNAL_SERVER_ERROR, new ActivitySpecErrorResponse(exception.getMessage()));
+    }
+
+    private Response transform(JsonMappingException jsonMappingException) {
+        LOGGER.error("Transforming JsonMappingException to Error Response " + jsonMappingException);
+        return generateResponse(Status.BAD_REQUEST, new ActivitySpecErrorResponse("Invalid Json Input"));
+    }
+
+    private Response generateResponse(Response.Status status, ActivitySpecErrorResponse activitySpecErrorResponse) {
+        return Response.status(status).entity(activitySpecErrorResponse).type(MediaType.APPLICATION_JSON).build();
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/utils/ActivitySpecConstant.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/utils/ActivitySpecConstant.java
new file mode 100644
index 0000000..a0da1c9
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/onap/sdc/activityspec/utils/ActivitySpecConstant.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.utils;
+
+public class ActivitySpecConstant {
+
+    public static final String CATEGORY_ATTRIBUTE_NAME = "category";
+    public static final String VERSION_ID_DEFAULT_VALUE = "latest";
+    public static final String TENANT = "activity_spec";
+    public static final String USER = "activity_spec_USER";
+    public static final String USER_ID_HEADER_PARAM = "USER_ID";
+    public static final String ACTIVITY_SPEC_NOT_FOUND = "No Activity Spec found for the given identifiers";
+    public static final String INVALID_STATE = "Activity Spec is in an invalid state";
+
+    private ActivitySpecConstant() {
+        //Utility Class declaring constants does not require instantiation.
+    }
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/ActivitySpecs.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/ActivitySpecs.java
deleted file mode 100644
index ae9e158..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/ActivitySpecs.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.rest;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecActionRequestDto;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecRequestDto;
-import org.springframework.validation.annotation.Validated;
-
-import javax.validation.Valid;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-@Path("/v1.0/activity-spec/")
-@Produces(MediaType.APPLICATION_JSON)
-@Consumes(MediaType.APPLICATION_JSON)
-@Api(value = "Activity Specs")
-@Validated
-public interface ActivitySpecs {
-  @POST
-  @Path("/")
-  @ApiOperation(value = "Create Activity Spec")
-  Response createActivitySpec(@Valid ActivitySpecRequestDto request);
-
-  @GET
-  @Path("/{id}/versions/{versionId}")
-  @ApiOperation(value = "Get Activity Spec")
-  Response getActivitySpec(@ApiParam(value = "Activity Spec Id") @PathParam("id")
-                                  String id,
-                              @ApiParam(value = "Version Id") @PathParam("versionId")
-                                  String versionId);
-
-  @PUT
-  @Path("/{id}/versions/{versionId}")
-  @ApiOperation(value = "Update Activity Spec")
-  Response updateActivitySpec(@Valid ActivitySpecRequestDto request,
-                              @ApiParam(value = "Activity Spec Id") @PathParam("id")
-                                  String id,
-                              @ApiParam(value = "Version Id") @PathParam("versionId")
-                                  String versionId);
-
-  @PUT
-  @Path("/{id}/versions/{versionId}/actions")
-  @ApiOperation(value = "Actions on a activity spec",
-      notes = "Performs one of the following actions on a activity spec: |"
-          + "CERTIFY: Certifies activity spec.|"
-          + "DEPRECATE: Deprecates activity spec.|"
-          + "DELETE: Deletes activity spec.")
-  Response actOnActivitySpec(ActivitySpecActionRequestDto request,
-      @ApiParam(value = "Activity Spec Id") @PathParam("id") String id,
-      @ApiParam(value = "Version Id") @PathParam("versionId") String versionId);
-
-  @GET
-  @Path("/")
-  @ApiOperation(value = "Get list of activity specs ",
-      responseContainer = "List")
-  Response list(@ApiParam(
-      value = "List activity specs based on status filter")
-                    @QueryParam("status") String versionStatus);
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java
deleted file mode 100644
index 2364d59..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecRequestDtoToActivitySpecEntity.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.rest.mapping;
-
-import java.util.ArrayList;
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-import org.openecomp.activityspec.be.datatypes.ActivitySpecParameter;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecRequestDto;
-import org.openecomp.sdcrests.mapping.MappingBase;
-
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-public class MapActivitySpecRequestDtoToActivitySpecEntity
-    extends MappingBase<ActivitySpecRequestDto,
-    ActivitySpecEntity> {
-
-  @Override
-  public void doMapping(ActivitySpecRequestDto source, ActivitySpecEntity target) {
-    target.setName(source.getName());
-    target.setDescription(source.getDescription());
-    target.setCategoryList(source.getCategoryList() == null ? new ArrayList<String>()
-        : source.getCategoryList());
-    if (Objects.nonNull(source.getInputs())) {
-      target.setInputs(source.getInputs().stream()
-          .map(activitySpecParameterDto -> new MapDtoToActivityParameter()
-              .applyMapping(activitySpecParameterDto, ActivitySpecParameter.class))
-                .collect(Collectors.toList()));
-    }
-    if (Objects.nonNull(source.getOutputs())) {
-      target.setOutputs(source.getOutputs().stream()
-          .map(activitySpecParameterDto -> new MapDtoToActivityParameter()
-              .applyMapping(activitySpecParameterDto, ActivitySpecParameter.class))
-          .collect(Collectors.toList()));
-    }
-    target.setType(source.getType());
-    target.setContent(source.getContent());
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecCreateResponse.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecCreateResponse.java
deleted file mode 100644
index 13c8814..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecCreateResponse.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.rest.mapping;
-
-import java.util.Objects;
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecCreateResponse;
-import org.openecomp.sdcrests.mapping.MappingBase;
-
-public class MapActivitySpecToActivitySpecCreateResponse extends MappingBase<ActivitySpecEntity,
-    ActivitySpecCreateResponse> {
-
-  @Override
-  public void doMapping(ActivitySpecEntity source, ActivitySpecCreateResponse target) {
-    target.setId(source.getId());
-    target.setVersionId(Objects.nonNull(source.getVersion()) ? source.getVersion().getId() : null);
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java
deleted file mode 100644
index 697e1bd..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapActivitySpecToActivitySpecGetResponse.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.rest.mapping;
-
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecGetResponse;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecParameterDto;
-import org.openecomp.sdcrests.mapping.MappingBase;
-
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-public class MapActivitySpecToActivitySpecGetResponse extends MappingBase<ActivitySpecEntity,
-    ActivitySpecGetResponse> {
-
-  @Override
-  public void doMapping(ActivitySpecEntity source, ActivitySpecGetResponse target) {
-    target.setName(source.getName());
-    target.setDescription(source.getDescription());
-    target.setCategoryList(source.getCategoryList());
-    if (Objects.nonNull(source.getInputs())) {
-      target.setInputs(source.getInputs().stream().map(
-          activitySpecParameter -> new MapActivityParameterToDto()
-              .applyMapping(activitySpecParameter, ActivitySpecParameterDto
-                  .class)).collect(Collectors.toList()));
-    }
-    if (Objects.nonNull(source.getOutputs())) {
-      target.setOutputs(source.getOutputs().stream().map(
-          activitySpecParameter -> new MapActivityParameterToDto()
-              .applyMapping(activitySpecParameter, ActivitySpecParameterDto
-                  .class)).collect(Collectors.toList()));
-    }
-    target.setStatus(source.getStatus());
-    target.setType(source.getType());
-    target.setContent(source.getContent());
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapDtoToActivityParameter.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapDtoToActivityParameter.java
deleted file mode 100644
index ccffaea..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapDtoToActivityParameter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.rest.mapping;
-
-import org.openecomp.activityspec.be.datatypes.ActivitySpecParameter;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecParameterDto;
-import org.openecomp.sdcrests.mapping.MappingBase;
-
-public class MapDtoToActivityParameter  extends MappingBase<ActivitySpecParameterDto,
-    ActivitySpecParameter> {
-  @Override
-  public void doMapping(ActivitySpecParameterDto source, ActivitySpecParameter target) {
-    target.setName(source.getName());
-    target.setType(source.getType());
-    target.setValue(source.getValue());
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapItemToListResponseDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapItemToListResponseDto.java
deleted file mode 100644
index c85d5af..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/mapping/MapItemToListResponseDto.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.rest.mapping;
-
-import org.openecomp.activityspec.api.rest.types.ActivitySpecListResponseDto;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.types.Item;
-import org.openecomp.sdcrests.mapping.MappingBase;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.CATEGORY_ATTRIBUTE_NAME;
-
-public class MapItemToListResponseDto extends MappingBase<Item, ActivitySpecListResponseDto> {
-  @Override
-  public void doMapping(Item source, ActivitySpecListResponseDto target) {
-    target.setId(source.getId());
-    target.setName(source.getName());
-    target.setCategoryList((List<String>) source.getProperties().get(
-        CATEGORY_ATTRIBUTE_NAME));
-    final Map<VersionStatus, Integer> versionStatusCounters = source.getVersionStatusCounters();
-    if (Objects.nonNull(versionStatusCounters) && !versionStatusCounters.isEmpty()) {
-      final Set<VersionStatus> versionStatuses = versionStatusCounters.keySet();
-      target.setStatus(versionStatuses.stream().findFirst().isPresent()
-          ? versionStatuses.stream().findFirst().get().name() : null);
-    }
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/services/ActivitySpecsImpl.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/services/ActivitySpecsImpl.java
deleted file mode 100644
index db2db40..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/services/ActivitySpecsImpl.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.rest.services;
-
-import org.openecomp.activityspec.api.rest.ActivitySpecs;
-import org.openecomp.activityspec.api.rest.mapping.MapActivitySpecRequestDtoToActivitySpecEntity;
-import org.openecomp.activityspec.api.rest.mapping.MapActivitySpecToActivitySpecCreateResponse;
-import org.openecomp.activityspec.api.rest.mapping.MapActivitySpecToActivitySpecGetResponse;
-import org.openecomp.activityspec.api.rest.mapping.MapItemToListResponseDto;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecActionRequestDto;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecCreateResponse;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecGetResponse;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecListResponseDto;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecRequestDto;
-import org.openecomp.activityspec.api.rest.types.InternalEmptyObject;
-import org.openecomp.activityspec.be.ActivitySpecManager;
-import org.openecomp.activityspec.be.dao.impl.ActivitySpecDaoZusammenImpl;
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-import org.openecomp.activityspec.be.impl.ActivitySpecManagerImpl;
-import org.openecomp.core.dao.UniqueValueDaoFactory;
-import org.openecomp.core.zusammen.api.ZusammenAdaptorFactory;
-import org.openecomp.sdc.versioning.ItemManagerFactory;
-import org.openecomp.sdc.versioning.VersioningManagerFactory;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper;
-import org.springframework.context.annotation.Scope;
-import org.springframework.stereotype.Service;
-import org.springframework.validation.annotation.Validated;
-
-import javax.ws.rs.core.Response;
-
-@Service("activitySpecs")
-@Scope(value = "singleton")
-@Validated
-public class ActivitySpecsImpl implements ActivitySpecs {
-
-
-  private final ActivitySpecManager activitySpecManager =
-      new ActivitySpecManagerImpl(ItemManagerFactory.getInstance().createInterface(),
-          VersioningManagerFactory.getInstance().createInterface(),
-          new ActivitySpecDaoZusammenImpl(ZusammenAdaptorFactory.getInstance().createInterface()),
-          UniqueValueDaoFactory.getInstance().createInterface());
-
-  @Override
-  public Response createActivitySpec(ActivitySpecRequestDto request) {
-    ActivitySpecEntity activitySpec = new MapActivitySpecRequestDtoToActivitySpecEntity()
-        .applyMapping(request, ActivitySpecEntity.class);
-
-    activitySpec = activitySpecManager.createActivitySpec(activitySpec);
-    ActivitySpecCreateResponse createActivitySpecResponse =
-        new MapActivitySpecToActivitySpecCreateResponse().applyMapping(activitySpec,
-            ActivitySpecCreateResponse.class);
-
-    return Response.ok(createActivitySpecResponse).build();
-  }
-
-  @Override
-  public Response getActivitySpec(String activitySpecId, String versionId) {
-    ActivitySpecEntity activitySpec = new ActivitySpecEntity();
-    activitySpec.setId(activitySpecId);
-    activitySpec.setVersion(new Version(versionId));
-    final ActivitySpecEntity retrieved = activitySpecManager.get(activitySpec);
-    ActivitySpecGetResponse getResponse = new MapActivitySpecToActivitySpecGetResponse()
-        .applyMapping(retrieved, ActivitySpecGetResponse.class);
-    return Response.ok(getResponse).build();
-  }
-
-  @Override
-  public Response updateActivitySpec(ActivitySpecRequestDto request, String activitySpecId,
-                                     String versionId) {
-    ActivitySpecEntity activitySpec = new MapActivitySpecRequestDtoToActivitySpecEntity()
-        .applyMapping(request, ActivitySpecEntity.class);
-
-    activitySpec.setId(activitySpecId);
-    activitySpec.setVersion(new Version(versionId));
-
-    activitySpecManager.update(activitySpec);
-
-    return Response.ok(new InternalEmptyObject()).build();
-  }
-
-  @Override
-  public Response actOnActivitySpec(ActivitySpecActionRequestDto request, String activitySpecId,
-                                    String versionId) {
-    activitySpecManager.actOnAction(activitySpecId, versionId, request.getAction());
-    return Response.ok(new InternalEmptyObject()).build();
-  }
-
-  @Override
-  public Response list(String versionStatus) {
-
-    GenericCollectionWrapper<ActivitySpecListResponseDto> results = new GenericCollectionWrapper<>();
-    MapItemToListResponseDto mapper = new MapItemToListResponseDto();
-    activitySpecManager.list(versionStatus).stream()
-        .sorted((o1, o2) -> o2.getModificationTime().compareTo(o1.getModificationTime()))
-        .forEach(activitySpecItem -> results.add(mapper.applyMapping(activitySpecItem,
-            ActivitySpecListResponseDto.class)));
-
-    return Response.ok(results).build();
-  }
-
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecRequestDto.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecRequestDto.java
deleted file mode 100644
index 08b07b8..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/rest/types/ActivitySpecRequestDto.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright © 2016-2017 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.rest.types;
-
-import io.swagger.annotations.ApiModel;
-import org.hibernate.validator.constraints.NotBlank;
-
-import javax.validation.constraints.Pattern;
-import java.util.List;
-
-@ApiModel(value = "ActivitySpecRequest")
-@lombok.Data
-public class ActivitySpecRequestDto {
-
-  @NotBlank(message = "Mandatory %s field is missing/null")
-  @Pattern(regexp = "^[a-zA-Z0-9-]*$", message = "%s should match with \"^[a-zA-Z0-9-]*$\" pattern")
-  private String name;
-  private String description;
-
-  private List<String> categoryList;
-  private List<ActivitySpecParameterDto> inputs;
-  private List<ActivitySpecParameterDto> outputs;
-  private String type;
-  private String content;
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/server/filters/ActivitySpecSessionContextFilter.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/server/filters/ActivitySpecSessionContextFilter.java
deleted file mode 100644
index 715d096..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/server/filters/ActivitySpecSessionContextFilter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.server.filters;
-
-import java.io.IOException;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response.Status;
-import org.apache.commons.lang.StringUtils;
-import org.openecomp.sdc.common.session.SessionContextProvider;
-import org.openecomp.sdc.common.session.SessionContextProviderFactory;
-
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.TENANT;
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.USER;
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.USER_ID_HEADER_PARAM;
-
-public class ActivitySpecSessionContextFilter implements Filter {
-
-  private static final String MESSAGE_USER_MAY_NOT_BE_NULL = "{\"message\": \"User ID can not be null\"}";
-
-  @Override
-  public void init(FilterConfig filterConfig) {
-    //No ActivitySpec specific initialization required
-  }
-
-  @Override
-  public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
-      FilterChain filterChain) throws IOException, ServletException {
-
-    final String userHeader = ((HttpServletRequest) servletRequest).getHeader(USER_ID_HEADER_PARAM);
-
-    // Not a real security, just make sure the request
-    // has passed some authentication gateway
-    if (StringUtils.isEmpty(userHeader)) {
-      sendErrorResponse(servletResponse);
-      return;
-    }
-
-    SessionContextProvider contextProvider = SessionContextProviderFactory.getInstance().createInterface();
-
-    try {
-      // use the system-wide user and tenant
-      contextProvider.create(USER, TENANT);
-      filterChain.doFilter(servletRequest, servletResponse);
-    } finally {
-      contextProvider.close();
-    }
-  }
-
-  private void sendErrorResponse(ServletResponse servletResponse) throws IOException {
-    HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
-    httpServletResponse.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
-    httpServletResponse.setStatus(Status.UNAUTHORIZED.getStatusCode());
-    servletResponse.getOutputStream().write(MESSAGE_USER_MAY_NOT_BE_NULL.getBytes());
-  }
-
-  @Override
-  public void destroy() {
-    //No ActivitySpec specific destroy required
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/server/listeners/ActivitySpecAppStartupListener.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/server/listeners/ActivitySpecAppStartupListener.java
deleted file mode 100644
index 8ddb7f3..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/api/server/listeners/ActivitySpecAppStartupListener.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.api.server.listeners;
-
-import org.openecomp.sdc.common.session.SessionContextProviderFactory;
-import org.springframework.web.context.ContextLoaderListener;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.TENANT;
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.USER;
-
-public class ActivitySpecAppStartupListener implements ServletContextListener {
-
-  ContextLoaderListener springListener;
-
-  @Override
-  public void contextInitialized(ServletContextEvent servletContextEvent) {
-    SessionContextProviderFactory.getInstance().createInterface().create(USER,
-        TENANT);
-    springListener = new ContextLoaderListener();
-    springListener.initWebApplicationContext(servletContextEvent.getServletContext());
-  }
-
-  @Override
-  public void contextDestroyed(ServletContextEvent servletContextEvent) {
-    springListener.closeWebApplicationContext(servletContextEvent.getServletContext());
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/ActivitySpecManager.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/ActivitySpecManager.java
deleted file mode 100644
index 4fa41d0..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/ActivitySpecManager.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright © 2016-2017 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.be;
-
-import java.util.Collection;
-
-import org.openecomp.activityspec.api.rest.types.ActivitySpecAction;
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-import org.openecomp.sdc.versioning.types.Item;
-
-public interface ActivitySpecManager {
-
-  ActivitySpecEntity createActivitySpec(ActivitySpecEntity activitySpecEntity);
-
-  ActivitySpecEntity get(ActivitySpecEntity activitySpec);
-
-  void update(ActivitySpecEntity activitySpec);
-
-  void actOnAction(String activitySpecId, String versionId, ActivitySpecAction action);
-
-  Collection<Item> list(String versionStatus);
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/ActivitySpecDao.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/ActivitySpecDao.java
deleted file mode 100644
index 375adac..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/ActivitySpecDao.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright © 2016-2017 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.be.dao;
-
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-
-public interface ActivitySpecDao {
-  void create(ActivitySpecEntity activitySpecEntity);
-
-  ActivitySpecEntity get(ActivitySpecEntity activitySpec);
-
-  void update(ActivitySpecEntity activitySpec);
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java
deleted file mode 100644
index 0dabcca..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecDaoZusammenImpl.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright © 2016-2017 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.be.dao.impl;
-
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Action;
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-
-import org.openecomp.activityspec.be.dao.ActivitySpecDao;
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-import org.openecomp.activityspec.utils.ActivitySpecConstant;
-import org.openecomp.activityspec.be.datatypes.ActivitySpecData;
-import org.openecomp.activityspec.be.datatypes.ElementType;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Objects;
-import java.util.Optional;
-
-import static org.openecomp.core.zusammen.api.ZusammenUtil.buildStructuralElement;
-import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
-
-public class ActivitySpecDaoZusammenImpl implements ActivitySpecDao {
-
-  private final ZusammenAdaptor zusammenAdaptor;
-
-  public ActivitySpecDaoZusammenImpl(ZusammenAdaptor zusammenAdaptor) {
-    this.zusammenAdaptor = zusammenAdaptor;
-  }
-
-  @Override
-  public void create(ActivitySpecEntity entity) {
-    SessionContext context = createSessionContext();
-    ZusammenElement generalElement = mapActivityDetailsToZusammenElement(entity, Action.CREATE);
-
-    ElementContext elementContext =
-        new ElementContext(entity.getId(), entity.getVersion().getId());
-    zusammenAdaptor.saveElement(context, elementContext, generalElement,
-        "Create Activity Spec General Info Element");
-  }
-
-  @Override
-  public ActivitySpecEntity get(ActivitySpecEntity entity) {
-    SessionContext context = createSessionContext();
-
-    ElementContext elementContext = new ElementContext(entity.getId(), entity.getVersion().getId());
-    Optional<Element> element = zusammenAdaptor.getElementByName(context, elementContext,
-        null, ElementType.ACTIVITYSPEC.name());
-    if (element.isPresent()) {
-      return mapZusammenElementToActivityDetails(element.get());
-    } else {
-      return null;
-    }
-  }
-
-  @Override
-  public void update(ActivitySpecEntity entity) {
-    SessionContext context = createSessionContext();
-    ZusammenElement generalElement = mapActivityDetailsToZusammenElement(entity, Action.UPDATE);
-
-    ElementContext elementContext =
-        new ElementContext(entity.getId(), entity.getVersion().getId());
-    zusammenAdaptor.saveElement(context, elementContext, generalElement,
-        "Update Activity Spec General Info Element");
-  }
-
-
-  private ActivitySpecEntity mapZusammenElementToActivityDetails(Element element) {
-    ActivitySpecEntity entity = new ActivitySpecEntity();
-    entity.setId(element.getElementId().getValue());
-    enrichEntityFromElementData(entity, element.getData());
-    enrichEntityFromElementInfo(entity, element.getInfo());
-    return entity;
-  }
-
-  private ZusammenElement mapActivityDetailsToZusammenElement(ActivitySpecEntity entity,
-                                                              Action action) {
-    ZusammenElement generalElement =
-        buildStructuralElement(ElementType.ACTIVITYSPEC.name(), action);
-
-    enrichElementInfoFromEntity(generalElement, entity);
-    enrichElementDataFromEntity(generalElement, entity);
-    return generalElement;
-  }
-
-
-  private void enrichEntityFromElementInfo(ActivitySpecEntity entity, Info info) {
-    entity.setName(info.getProperty(InfoPropertyName.NAME.getValue()));
-    entity.setDescription(info.getProperty(InfoPropertyName.DESCRIPTION.getValue()));
-    entity.setCategoryList(info.getProperty(InfoPropertyName.CATEGORY.getValue()));
-  }
-
-  private void enrichEntityFromElementData(ActivitySpecEntity entity, InputStream data) {
-    ActivitySpecData activitySpecData = JsonUtil.json2Object(data, ActivitySpecData.class);
-    if (Objects.nonNull(activitySpecData)) {
-      entity.setInputs(activitySpecData.getInputs());
-      entity.setOutputs(activitySpecData.getOutputs());
-      entity.setType(activitySpecData.getType());
-      entity.setContent(activitySpecData.getContent());
-    }
-  }
-
-  private void enrichElementInfoFromEntity(ZusammenElement element, ActivitySpecEntity entity) {
-    element.getInfo().addProperty(InfoPropertyName.DESCRIPTION.getValue(), entity.getDescription());
-    element.getInfo().addProperty(InfoPropertyName.NAME.getValue(), entity.getName());
-    element.getInfo().addProperty(InfoPropertyName.CATEGORY.getValue(),
-        entity.getCategoryList());
-  }
-
-
-  private void enrichElementDataFromEntity(ZusammenElement element, ActivitySpecEntity entity) {
-    ActivitySpecData activitySpecData = new ActivitySpecData();
-    activitySpecData.setInputs(entity.getInputs());
-    activitySpecData.setOutputs(entity.getOutputs());
-    activitySpecData.setType(entity.getType());
-    activitySpecData.setContent(entity.getContent());
-    element.setData(new ByteArrayInputStream(JsonUtil.object2Json(activitySpecData).getBytes()));
-  }
-
-  public enum InfoPropertyName {
-    DESCRIPTION("description"),
-    NAME("name"),
-    CATEGORY(ActivitySpecConstant.CATEGORY_ATTRIBUTE_NAME);
-
-    private final String value;
-
-    InfoPropertyName(String value) {
-      this.value = value;
-    }
-
-    public String getValue() {
-      return value;
-    }
-  }
-
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/types/ActivitySpecEntity.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/types/ActivitySpecEntity.java
deleted file mode 100644
index 2f261f8..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/dao/types/ActivitySpecEntity.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright © 2016-2017 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.be.dao.types;
-
-import org.openecomp.activityspec.be.datatypes.ActivitySpecParameter;
-import org.openecomp.sdc.versioning.dao.types.Version;
-
-import java.util.List;
-
-@lombok.Data
-public class ActivitySpecEntity {
-  private String id;
-  private Version version;
-  private String name;
-  private String description;
-
-  private List<String> categoryList;
-  private List<ActivitySpecParameter> inputs;
-  private List<ActivitySpecParameter> outputs;
-  private String type;
-  private String content;
-
-  //Not to be maintained in activityspec element
-  private String status;
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/impl/ActivitySpecManagerImpl.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/impl/ActivitySpecManagerImpl.java
deleted file mode 100644
index 4438373..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/be/impl/ActivitySpecManagerImpl.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright © 2016-2017 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.be.impl;
-
-import static org.openecomp.activityspec.api.rest.types.ActivitySpecAction.CERTIFY;
-import static org.openecomp.activityspec.api.rest.types.ActivitySpecAction.DELETE;
-import static org.openecomp.activityspec.api.rest.types.ActivitySpecAction.DEPRECATE;
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.ACTIVITY_SPEC_NOT_FOUND;
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.INVALID_STATE;
-import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Certified;
-import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Deleted;
-import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Deprecated;
-import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Draft;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.function.Predicate;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecAction;
-import org.openecomp.activityspec.be.ActivitySpecManager;
-import org.openecomp.activityspec.be.dao.ActivitySpecDao;
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-import org.openecomp.activityspec.be.datatypes.ItemType;
-import org.openecomp.activityspec.errors.ActivitySpecNotFoundException;
-import org.openecomp.activityspec.utils.ActivitySpecConstant;
-import org.openecomp.core.dao.UniqueValueDao;
-import org.openecomp.core.util.UniqueValueUtil;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.common.errors.ErrorCategory;
-import org.openecomp.sdc.common.errors.ErrorCode;
-import org.openecomp.sdc.common.errors.SdcRuntimeException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.versioning.ItemManager;
-import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.types.Item;
-import org.openecomp.sdc.versioning.types.VersionCreationMethod;
-
-public class ActivitySpecManagerImpl implements ActivitySpecManager {
-
-  private static final Map<VersionStatus, Transition> TRANSITIONS;
-
-  static {
-    TRANSITIONS = new EnumMap<>(VersionStatus.class);
-    TRANSITIONS.put(Certified, new Transition("Certify", Draft));
-    TRANSITIONS.put(Deprecated, new Transition("Deprecate", Certified));
-    TRANSITIONS.put(Deleted, new Transition("Delete", Deprecated));
-  }
-
-  private final ItemManager itemManager;
-  private final VersioningManager versioningManager;
-  private final ActivitySpecDao activitySpecDao;
-  private final UniqueValueUtil uniqueValueUtil;
-  private static final String ACTIVITY_SPEC_NAME = "ActivitySpec.Name";
-  private static final Logger LOGGER =
-      LoggerFactory.getLogger(ActivitySpecManagerImpl.class);
-
-  public ActivitySpecManagerImpl(ItemManager itemManager,
-                                 VersioningManager versioningManager,
-                                 ActivitySpecDao activitySpecDao,
-                                 UniqueValueDao uniqueValueDao) {
-    this.itemManager = itemManager;
-    this.versioningManager = versioningManager;
-    this.activitySpecDao = activitySpecDao;
-    this.uniqueValueUtil = new UniqueValueUtil(uniqueValueDao);
-  }
-
-  @Override
-  public ActivitySpecEntity createActivitySpec(ActivitySpecEntity activitySpecEntity) {
-
-    validateUniqueValue(activitySpecEntity);
-
-    Item item = getActivitySpecItem(activitySpecEntity);
-    item = itemManager.create(item);
-
-    Version version = getActivitySpecVersion(activitySpecEntity);
-    versioningManager.create(item.getId(), version, VersionCreationMethod.major);
-
-    enrichActivitySpec(item, version, activitySpecEntity);
-    activitySpecDao.create(activitySpecEntity);
-
-    uniqueValueUtil.createUniqueValue(ACTIVITY_SPEC_NAME, activitySpecEntity.getName());
-    return activitySpecEntity;
-  }
-
-  private void validateUniqueValue(ActivitySpecEntity activitySpecEntity) {
-    try {
-      uniqueValueUtil.validateUniqueValue(ACTIVITY_SPEC_NAME, activitySpecEntity.getName());
-    } catch (CoreException exception) {
-      LOGGER.debug("Unique value error for activity spec name :" + activitySpecEntity.getName(), exception);
-      throw new CoreException(new ErrorCode.ErrorCodeBuilder()
-          .withCategory(ErrorCategory.APPLICATION)
-          .withId(exception.code().id())
-          .withMessage("name already in use").build());
-    }
-  }
-
-  private Version getActivitySpecVersion(ActivitySpecEntity activitySpecEntity) {
-    return activitySpecEntity.getVersion() == null ? new Version()
-        : activitySpecEntity.getVersion();
-
-  }
-
-  @Override
-  public ActivitySpecEntity get(ActivitySpecEntity activitySpec) {
-    activitySpec.setVersion(calculateLatestVersion(activitySpec.getId(),activitySpec.getVersion()));
-    ActivitySpecEntity retrieved;
-    try {
-      retrieved = activitySpecDao.get(activitySpec);
-    } catch (SdcRuntimeException runtimeException) {
-      LOGGER.debug("Failed to retrieve activity spec for activitySpecId: " + activitySpec.getId()
-          + " and version: " + activitySpec.getVersion().getId(), runtimeException);
-      throw new ActivitySpecNotFoundException(ACTIVITY_SPEC_NOT_FOUND, runtimeException);
-    }
-    if (retrieved != null) {
-      final Version retrievedVersion = versioningManager.get(activitySpec.getId(),
-          activitySpec.getVersion());
-      retrieved.setStatus(Objects.nonNull(retrievedVersion) ? retrievedVersion.getStatus().name()
-          : null);
-    }
-    return retrieved;
-  }
-
-  @Override
-  public void update(ActivitySpecEntity activitySpec) {
-
-    ActivitySpecEntity previousActivitySpec = get(activitySpec);
-
-    if (!activitySpec.getName().equals(previousActivitySpec.getName())) {
-      validateUniqueValue(activitySpec);
-    }
-
-    activitySpecDao.update(activitySpec);
-
-    if (!activitySpec.getName().equals(previousActivitySpec.getName())) {
-      uniqueValueUtil.createUniqueValue(ACTIVITY_SPEC_NAME, activitySpec.getName());
-      itemManager.updateName(activitySpec.getId(), activitySpec.getName());
-      uniqueValueUtil.deleteUniqueValue(ACTIVITY_SPEC_NAME, previousActivitySpec.getName());
-    }
-  }
-
-  @Override
-  public void actOnAction(String activitySpecId, String versionId, ActivitySpecAction action) {
-    Version version = new Version(versionId);
-    version = calculateLatestVersion(activitySpecId, version);
-    if (action == CERTIFY) {
-      version.setStatus(Certified);
-    }
-    if (action == DEPRECATE) {
-      version.setStatus(Deprecated);
-    }
-    if (action == DELETE) {
-      version.setStatus(Deleted);
-    }
-
-    updateVersionStatus(activitySpecId, action, version);
-    if (action == DELETE) {
-      ActivitySpecEntity entity = new ActivitySpecEntity();
-      entity.setId(activitySpecId);
-      entity.setVersion(version);
-      final ActivitySpecEntity activitySpecEntity = get(entity);
-      uniqueValueUtil.deleteUniqueValue(ACTIVITY_SPEC_NAME, activitySpecEntity.getName());
-    }
-  }
-
-  private void updateVersionStatus(String activitySpecId, ActivitySpecAction action,
-      Version version) {
-    VersionStatus prevVersionStatus = null;
-    Version retrievedVersion;
-    try {
-      retrievedVersion = versioningManager.get(activitySpecId, version);
-    } catch (SdcRuntimeException exception) {
-      LOGGER.debug("Failed to get version for activitySpecId: " + activitySpecId
-              + " and version: " + version.getId(), exception);
-      throw new ActivitySpecNotFoundException(ACTIVITY_SPEC_NOT_FOUND, exception);
-
-    }
-
-    VersionStatus status = version.getStatus();
-    Transition transition = TRANSITIONS.get(status);
-    if (transition != null) {
-
-      VersionStatus retrievedStatus = Objects.nonNull(retrievedVersion) ? retrievedVersion.getStatus() : null;
-      if (retrievedStatus != transition.prevStatus) {
-        LOGGER.debug("Failed to " + version.getStatus() + " since activity spec is in "
-            + retrievedStatus);
-        throw new CoreException(new ErrorCode.ErrorCodeBuilder()
-            .withMessage(INVALID_STATE).build());
-      }
-      prevVersionStatus = transition.prevStatus;
-    }
-
-    if (Objects.nonNull(retrievedVersion)) {
-      retrievedVersion.setStatus(status);
-      versioningManager.updateVersion(activitySpecId, retrievedVersion);
-      itemManager.updateVersionStatus(activitySpecId, status, prevVersionStatus);
-      versioningManager.publish(activitySpecId, retrievedVersion, "actionOnActivitySpec :"
-          + action.name());
-    }
-  }
-
-  private Version calculateLatestVersion(String activitySpecId, Version version) {
-    if (ActivitySpecConstant.VERSION_ID_DEFAULT_VALUE.equalsIgnoreCase(version.getId())) {
-      List<Version> list;
-      try {
-        list = versioningManager.list(activitySpecId);
-      } catch (SdcRuntimeException runtimeException) {
-        LOGGER.debug("Failed to list versions for activitySpecId "
-            + activitySpecId, runtimeException);
-        throw new ActivitySpecNotFoundException(ACTIVITY_SPEC_NOT_FOUND, runtimeException);
-      }
-      if (Objects.nonNull(list) && !list.isEmpty()) {
-        return list.get(0);
-      }
-    }
-    return version;
-  }
-
-  @Override
-  public Collection<Item> list(String versionStatus) {
-    Predicate<Item> itemPredicate;
-    if (Objects.nonNull(versionStatus)) {
-
-      VersionStatus statusEnumValue;
-
-      try {
-        statusEnumValue = VersionStatus.valueOf(versionStatus);
-      } catch (IllegalArgumentException e) {
-        LOGGER.debug("Unexpected value of VersionStatus {}", versionStatus);
-        return Collections.emptyList();
-      }
-
-      itemPredicate = item -> ItemType.ACTIVITYSPEC.name().equals(item.getType())
-          && item.getVersionStatusCounters().containsKey(statusEnumValue);
-
-    } else {
-      itemPredicate = item -> ItemType.ACTIVITYSPEC.name().equals(item.getType());
-    }
-
-    return itemManager.list(itemPredicate);
-  }
-
-  private void enrichActivitySpec(Item item, Version version,
-                                  ActivitySpecEntity activitySpecEntity) {
-    activitySpecEntity.setId(item.getId());
-    activitySpecEntity.setVersion(version);
-  }
-
-  private Item getActivitySpecItem(ActivitySpecEntity activitySpecEntity) {
-    Item item = new Item();
-    item.setType(ItemType.ACTIVITYSPEC.name());
-    item.setName(activitySpecEntity.getName());
-    if (activitySpecEntity.getId() != null) {
-      item.setId(activitySpecEntity.getId());
-    }
-    item.addProperty(ActivitySpecConstant.CATEGORY_ATTRIBUTE_NAME,
-        activitySpecEntity.getCategoryList());
-    return item;
-  }
-
-  private static class Transition {
-
-    private final String action;
-    private final VersionStatus prevStatus;
-
-    private Transition(String action, VersionStatus prevStatus) {
-      this.action = action;
-      this.prevStatus = prevStatus;
-    }
-  }
-
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/errors/ActivitySpecErrorResponse.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/errors/ActivitySpecErrorResponse.java
deleted file mode 100644
index 18ae886..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/errors/ActivitySpecErrorResponse.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.errors;
-
-@lombok.Data
-public class ActivitySpecErrorResponse {
-  private String message;
-
-  public ActivitySpecErrorResponse() {
-    //default constructor
-  }
-
-  public ActivitySpecErrorResponse(String message) {
-    this.message = message;
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/errors/DefaultExceptionMapper.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/errors/DefaultExceptionMapper.java
deleted file mode 100644
index 950988a..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/errors/DefaultExceptionMapper.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.errors;
-
-import java.util.Set;
-import javax.validation.ConstraintViolation;
-import javax.validation.ConstraintViolationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.ext.ExceptionMapper;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.hibernate.validator.internal.engine.path.PathImpl;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-
-public class DefaultExceptionMapper implements ExceptionMapper<Exception> {
-
-  private static final Logger LOGGER = LoggerFactory.getLogger(DefaultExceptionMapper.class);
-
-  @Override
-  public Response toResponse(Exception exception) {
-    Response response;
-    if (exception instanceof CoreException) {
-      response = transform(CoreException.class.cast(exception));
-    } else if (exception instanceof ActivitySpecNotFoundException) {
-      response = transform(ActivitySpecNotFoundException.class.cast(exception));
-    } else if (exception instanceof ConstraintViolationException) {
-      response = transform(ConstraintViolationException.class.cast(exception));
-    } else if (exception instanceof JsonMappingException) {
-      response = transform(JsonMappingException.class.cast(exception));
-    } else {
-      response = transform(exception);
-    }
-
-    return response;
-  }
-
-  private Response transform(ActivitySpecNotFoundException notFoundException) {
-    LOGGER.error("Transforming ActivitySpecNotFoundException to Error Response  :", notFoundException);
-    return generateResponse(Status.NOT_FOUND, new ActivitySpecErrorResponse(notFoundException.getMessage()));
-  }
-
-  private Response transform(CoreException coreException) {
-    LOGGER.error("Transforming CoreException to Error Response  :", coreException);
-    return generateResponse(Status.BAD_REQUEST, new ActivitySpecErrorResponse(coreException.getMessage()));
-  }
-
-  private Response transform(ConstraintViolationException validationException) {
-    LOGGER.error("Transforming ConstraintViolationException to Error Response :",
-        validationException);
-    Set<ConstraintViolation<?>> constraintViolationSet = validationException
-        .getConstraintViolations();
-    String message;
-
-    String fieldName = null;
-    if (constraintViolationSet != null) {
-      // getting the first violation message for the output response.
-      ConstraintViolation<?> constraintViolation = constraintViolationSet.iterator().next();
-      message = constraintViolation.getMessage();
-      fieldName = ((PathImpl) constraintViolation.getPropertyPath()).getLeafNode().toString();
-
-    } else {
-      message = validationException.getMessage();
-    }
-    return generateResponse(Status.BAD_REQUEST, new ActivitySpecErrorResponse(String.format(message,fieldName)));
-  }
-
-  private Response transform(Exception exception) {
-    LOGGER.error("Transforming Exception to Error Response " + exception);
-    return generateResponse(Status.INTERNAL_SERVER_ERROR, new ActivitySpecErrorResponse(exception.getMessage()));
-  }
-
-  private Response transform(JsonMappingException jsonMappingException) {
-    LOGGER.error("Transforming JsonMappingException to Error Response " + jsonMappingException);
-    return generateResponse(Status.BAD_REQUEST, new ActivitySpecErrorResponse("Invalid Json Input"));
-  }
-
-  private Response generateResponse(Response.Status status, ActivitySpecErrorResponse
-      activitySpecErrorResponse) {
-    return Response.status(status).entity(activitySpecErrorResponse).type(MediaType
-        .APPLICATION_JSON).build();
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/utils/ActivitySpecConstant.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/utils/ActivitySpecConstant.java
deleted file mode 100644
index f63810d..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/main/java/org/openecomp/activityspec/utils/ActivitySpecConstant.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.utils;
-
-public class ActivitySpecConstant {
-
-  public static final String CATEGORY_ATTRIBUTE_NAME = "category";
-  public static final String VERSION_ID_DEFAULT_VALUE = "latest";
-  public static final String TENANT = "activity_spec";
-  public static final String USER = "activity_spec_USER";
-  public static final String USER_ID_HEADER_PARAM = "USER_ID";
-  public static final String ACTIVITY_SPEC_NOT_FOUND = "No Activity Spec found for the given identifiers";
-  public static final String INVALID_STATE = "Activity Spec is in an invalid state";
-
-  private ActivitySpecConstant(){
-    //Utility Class declaring constants does not require instantiation.
-  }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/onap/sdc/activityspec/be/dao/impl/ActivitySpecZusammenDaoImplTest.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/onap/sdc/activityspec/be/dao/impl/ActivitySpecZusammenDaoImplTest.java
new file mode 100644
index 0000000..26b9adb
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/onap/sdc/activityspec/be/dao/impl/ActivitySpecZusammenDaoImplTest.java
@@ -0,0 +1,368 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.be.dao.impl;
+
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementConflict;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ItemVersionConflict;
+import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
+import com.amdocs.zusammen.commons.health.data.HealthInfo;
+import com.amdocs.zusammen.datatypes.Id;
+import com.amdocs.zusammen.datatypes.SessionContext;
+import com.amdocs.zusammen.datatypes.item.Action;
+import com.amdocs.zusammen.datatypes.item.ElementContext;
+import com.amdocs.zusammen.datatypes.item.Info;
+import com.amdocs.zusammen.datatypes.item.Item;
+import com.amdocs.zusammen.datatypes.item.ItemVersion;
+import com.amdocs.zusammen.datatypes.item.ItemVersionData;
+import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
+import com.amdocs.zusammen.datatypes.item.Resolution;
+import com.amdocs.zusammen.datatypes.itemversion.ItemVersionRevisions;
+import com.amdocs.zusammen.datatypes.itemversion.Tag;
+
+import java.io.InputStream;
+
+import org.onap.sdc.activityspec.be.dao.impl.ActivitySpecDaoZusammenImpl.InfoPropertyName;
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
+import org.onap.sdc.activityspec.be.datatypes.ActivitySpecData;
+import org.onap.sdc.activityspec.be.datatypes.ActivitySpecParameter;
+import org.onap.sdc.activityspec.be.datatypes.ElementType;
+import org.openecomp.core.utilities.json.JsonUtil;
+import org.openecomp.core.zusammen.api.ZusammenAdaptor;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.types.ElementPropertyName;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
+
+public class ActivitySpecZusammenDaoImplTest {
+
+    private static final Version version = new Version();
+    private static final String versionId = "1234";
+    private static final String itemId = "5678";
+    private static final String tenant = "dox";
+
+    private ZusammenAdaptorMock zusammenAdaptor;
+    private ActivitySpecDaoZusammenImpl daoImpl;
+    private ActivitySpecEntity entity;
+
+
+    @BeforeMethod
+    public void setUp() {
+        SessionContextProviderFactory.getInstance().createInterface().create("test", tenant);
+        zusammenAdaptor = new ZusammenAdaptorMock();
+        daoImpl = new ActivitySpecDaoZusammenImpl(zusammenAdaptor);
+        entity = new ActivitySpecEntity();
+        entity = new ActivitySpecEntity();
+
+        entity.setId(itemId);
+        version.setId(versionId);
+        entity.setVersion(version);
+        entity.setName("activitySpec");
+        List<String> categoryList = new ArrayList<>();
+        categoryList.add("category1");
+        entity.setCategoryList(categoryList);
+        ActivitySpecParameter inputParams = new ActivitySpecParameter("dbhost", "String");
+        inputParams.setValue("localhost");
+        List<ActivitySpecParameter> inputs = new ArrayList<>();
+        inputs.add(inputParams);
+        entity.setInputs(inputs);
+    }
+
+    @AfterMethod
+    public void tearDown() {
+        SessionContextProviderFactory.getInstance().createInterface().close();
+    }
+
+    @Test
+    public void testCreate() {
+        ItemVersion itemVersionmock = new ItemVersion();
+        itemVersionmock.setId(new Id());
+
+        daoImpl.create(entity);
+        SessionContext context = createSessionContext();
+        ElementContext elementContext = new ElementContext(entity.getId(), entity.getVersion().getId());
+        Optional<ElementInfo> testElementInfo =
+                zusammenAdaptor.getElementInfoByName(context, elementContext, Id.ZERO, ElementType.ACTIVITYSPEC.name());
+        Assert.assertTrue(testElementInfo.isPresent());
+        Assert.assertEquals(testElementInfo.get().getInfo().getName(), ElementType.ACTIVITYSPEC.name());
+        Assert.assertEquals(testElementInfo.get().getInfo().getProperty(
+                ActivitySpecDaoZusammenImpl.InfoPropertyName.DESCRIPTION.getValue()), entity.getDescription());
+        Assert.assertEquals(testElementInfo.get().getInfo().getProperty(InfoPropertyName.CATEGORY.getValue()),
+                entity.getCategoryList());
+        Assert.assertEquals(testElementInfo.get().getInfo()
+                                           .getProperty(ActivitySpecDaoZusammenImpl.InfoPropertyName.NAME.getValue()),
+                entity.getName());
+
+        final Optional<Element> testElement =
+                zusammenAdaptor.getElement(context, elementContext, zusammenAdaptor.elementId);
+        final InputStream data = testElement.get().getData();
+        final ActivitySpecData activitySpecData = JsonUtil.json2Object(data, ActivitySpecData.class);
+        Assert.assertEquals(activitySpecData.getInputs().get(0).getName(), entity.getInputs().get(0).getName());
+    }
+
+    @Test
+    public void testGet() {
+        final ActivitySpecEntity retrieved = daoImpl.get(entity);
+        Assert.assertEquals(retrieved.getName(), entity.getName());
+        Assert.assertEquals(retrieved.getDescription(), entity.getDescription());
+        Assert.assertEquals(retrieved.getCategoryList(), entity.getCategoryList());
+    }
+
+    @Test
+    public void testUpdate() {
+        entity.setDescription("Update AS version1");
+        daoImpl.update(entity);
+        final ActivitySpecEntity retrieved = daoImpl.get(entity);
+        Assert.assertEquals(retrieved.getName(), entity.getName());
+        Assert.assertEquals(retrieved.getDescription(), entity.getDescription());
+        Assert.assertEquals(retrieved.getCategoryList(), entity.getCategoryList());
+    }
+
+    private class ZusammenAdaptorMock implements ZusammenAdaptor {
+
+        private ItemVersion itemVersion;
+        private final Map<String, Element> elementMap = new HashMap<>();
+        String elementId;
+
+        @Override
+        public Optional<ItemVersion> getFirstVersion(SessionContext context, Id itemId) {
+
+            return Optional.ofNullable(itemVersion);
+        }
+
+        @Override
+        public Collection<ItemVersion> listPublicVersions(SessionContext context, Id itemId) {
+            return null;
+        }
+
+        @Override
+        public ItemVersion getPublicVersion(SessionContext context, Id itemId, Id versionId) {
+            return null;
+        }
+
+        @Override
+        public Optional<Element> getElement(SessionContext context, ElementContext elementContext, String elementId) {
+            return Optional.of(elementMap.get(elementId));
+        }
+
+        @Override
+        public Optional<Element> getElementByName(SessionContext context, ElementContext elementContext,
+                                                         Id parentElementId, String elementName) {
+            //return Optional.empty();
+            ZusammenElement element = new ZusammenElement();
+            Info info = new Info();
+            element.setElementId(Id.ZERO);
+            info.addProperty("name", entity.getName());
+            info.addProperty("description", entity.getDescription());
+            info.addProperty("category", entity.getCategoryList());
+            element.setInfo(info);
+            return Optional.ofNullable(element);
+        }
+
+        @Override
+        public Collection<ElementInfo> listElements(SessionContext context, ElementContext elementContext,
+                                                           Id parentElementId) {
+            return null;
+        }
+
+        @Override
+        public Collection<Element> listElementData(SessionContext context, ElementContext elementContext,
+                                                          Id parentElementId) {
+            return elementMap.values();
+        }
+
+        @Override
+        public Collection<ElementInfo> listElementsByName(SessionContext context, ElementContext elementContext,
+                                                                 Id parentElementId, String elementName) {
+
+            return elementMap.values().stream()
+                                                       .filter(element -> elementName.equals(element.getInfo()
+                                                                                                   .getProperty(
+                                                                                        ElementPropertyName.elementType
+                                                                                        .name())))
+                             .map(element -> {
+                                 ElementInfo elementInfo = new ElementInfo();
+                                 elementInfo.setId(element.getElementId());
+                                 elementInfo.setInfo(element.getInfo());
+                                 return elementInfo;
+                             }).collect(Collectors.toList());
+
+        }
+
+        @Override
+        public Optional<ElementInfo> getElementInfoByName(SessionContext context, ElementContext elementContext,
+                                                                 Id parentElementId, String elementName) {
+
+
+            return elementMap.values().stream()
+                                                       .filter(element -> elementName.equals(element.getInfo()
+                                                                                      .getProperty(
+                                                                                        ElementPropertyName.elementType
+                                                                                                           .name())))
+                             .map(element -> {
+                                 ElementInfo elementInfo = new ElementInfo();
+                                 elementInfo.setId(element.getElementId());
+                                 elementInfo.setInfo(element.getInfo());
+                                 return elementInfo;
+                             }).findAny();
+
+
+        }
+
+        @Override
+        public Element saveElement(SessionContext context, ElementContext elementContext, ZusammenElement element,
+                                          String message) {
+            if (element.getAction().equals(Action.CREATE) || element.getAction().equals(Action.UPDATE)) {
+                element.setElementId(new Id(UUID.randomUUID().toString()));
+            }
+            elementMap.put(element.getElementId().getValue(), element);
+            elementId = element.getElementId().getValue();
+            return element;
+        }
+
+        @Override
+        public void resolveElementConflict(SessionContext context, ElementContext elementContext,
+                                                  ZusammenElement element, Resolution resolution) {
+
+        }
+
+        @Override
+        public Collection<HealthInfo> checkHealth(SessionContext context) {
+            return null;
+        }
+
+        @Override
+        public Id createItem(SessionContext context, Info info) {
+            return null;
+        }
+
+        @Override
+        public void updateItem(SessionContext context, Id itemId, Info info) {
+
+        }
+
+        @Override
+        public Id createVersion(SessionContext context, Id itemId, Id baseVersionId, ItemVersionData itemVersionData) {
+            return null;
+        }
+
+        @Override
+        public void updateVersion(SessionContext context, Id itemId, Id versionId, ItemVersionData itemVersionData) {
+
+        }
+
+        @Override
+        public ItemVersion getVersion(SessionContext context, Id itemId, Id versionId) {
+            return null;
+        }
+
+        @Override
+        public String getVersion(SessionContext sessionContext) {
+            return null;
+        }
+
+        @Override
+        public ItemVersionStatus getVersionStatus(SessionContext context, Id itemId, Id versionId) {
+            return null;
+        }
+
+        @Override
+        public ItemVersionConflict getVersionConflict(SessionContext context, Id itemId, Id versionId) {
+            return null;
+        }
+
+        @Override
+        public void tagVersion(SessionContext context, Id itemId, Id versionId, Tag tag) {
+
+        }
+
+        @Override
+        public void resetVersionHistory(SessionContext context, Id itemId, Id versionId, String changeRef) {
+
+        }
+
+
+        @Override
+        public void publishVersion(SessionContext context, Id itemId, Id versionId, String message) {
+
+        }
+
+        @Override
+        public void syncVersion(SessionContext sessionContext, Id itemId, Id versionId) {
+
+        }
+
+        @Override
+        public void forceSyncVersion(SessionContext context, Id itemId, Id versionId) {
+
+        }
+
+        @Override
+        public Optional<ElementInfo> getElementInfo(SessionContext context, ElementContext elementContext,
+                                                           Id elementId) {
+            return Optional.empty();
+        }
+
+        @Override
+        public void revert(SessionContext sessionContext, Id itemId, Id versionId, Id revisionId) {
+
+        }
+
+        @Override
+        public ItemVersionRevisions listRevisions(SessionContext sessionContext, Id itemId, Id versionId) {
+            return null;
+        }
+
+        @Override
+        public Optional<ElementConflict> getElementConflict(SessionContext context, ElementContext elementContext,
+                                                                   Id id) {
+            return Optional.empty();
+        }
+
+        @Override
+        public Collection<Item> listItems(SessionContext context) {
+            return null;
+        }
+
+        @Override
+        public Item getItem(SessionContext context, Id itemId) {
+            return null;
+        }
+
+        @Override
+        public void deleteItem(SessionContext context, Id itemId) {
+
+        }
+
+    }
+
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/onap/sdc/activityspec/be/impl/ActivitySpecManagerImplTest.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/onap/sdc/activityspec/be/impl/ActivitySpecManagerImplTest.java
new file mode 100644
index 0000000..21d1709
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/onap/sdc/activityspec/be/impl/ActivitySpecManagerImplTest.java
@@ -0,0 +1,302 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.sdc.activityspec.be.impl;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
+import org.onap.sdc.activityspec.be.dao.ActivitySpecDao;
+import org.onap.sdc.activityspec.api.rest.types.ActivitySpecAction;
+import org.onap.sdc.activityspec.be.dao.types.ActivitySpecEntity;
+import org.onap.sdc.activityspec.be.datatypes.ActivitySpecParameter;
+import org.onap.sdc.activityspec.errors.ActivitySpecNotFoundException;
+import org.openecomp.core.dao.UniqueValueDao;
+import org.openecomp.sdc.common.errors.CoreException;
+import org.openecomp.sdc.common.errors.SdcRuntimeException;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+import org.openecomp.sdc.versioning.ItemManager;
+import org.openecomp.sdc.versioning.VersioningManager;
+import org.openecomp.sdc.versioning.dao.types.Version;
+import org.openecomp.sdc.versioning.dao.types.VersionStatus;
+import org.openecomp.sdc.versioning.types.Item;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.verify;
+import static org.onap.sdc.activityspec.utils.ActivitySpecConstant.ACTIVITY_SPEC_NOT_FOUND;
+import static org.onap.sdc.activityspec.utils.ActivitySpecConstant.INVALID_STATE;
+import static org.onap.sdc.activityspec.utils.ActivitySpecConstant.VERSION_ID_DEFAULT_VALUE;
+
+public class ActivitySpecManagerImplTest {
+
+    private static final String STRING_TYPE = "String";
+    private static final String TEST_ERROR_MSG = "Test Error";
+    private ActivitySpecEntity input;
+    private static final Version VERSION01 = new Version("12345");
+    private static final String ID = "ID1";
+
+    @Spy
+    @InjectMocks
+    private ActivitySpecManagerImpl activitySpecManager;
+
+    @Mock
+    private ItemManager itemManagerMock;
+
+    @Mock
+    private VersioningManager versionManagerMock;
+
+    @Mock
+    private ActivitySpecDao activitySpecDaoMock;
+
+    //This is used to mock UniqueValueUtil. This should not be removed.
+    @Mock
+    private UniqueValueDao uniqueValueDaoMock;
+
+    @BeforeMethod
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+    }
+
+    @AfterMethod
+    public void tearDown() {
+        activitySpecManager = null;
+    }
+
+    @Test
+    public void testCreate() {
+
+        SessionContextProviderFactory.getInstance().createInterface().create("testUser", "testTenant");
+
+        ActivitySpecEntity activitySpecToCreate = new ActivitySpecEntity();
+        activitySpecToCreate.setName("startserver");
+        activitySpecToCreate.setDescription("start the server");
+        activitySpecToCreate.setVersion(VERSION01);
+
+        List<String> categoryList = new ArrayList<>();
+        categoryList.add("category1");
+        categoryList.add("category2");
+        activitySpecToCreate.setCategoryList(categoryList);
+
+        ActivitySpecParameter inputParams = new ActivitySpecParameter("dbhost", STRING_TYPE);
+        inputParams.setValue("localhost");
+        ActivitySpecParameter inputParams1 = new ActivitySpecParameter("dbname", STRING_TYPE);
+        inputParams.setValue("prod");
+        List<ActivitySpecParameter> inputs = new ArrayList<>();
+        inputs.add(inputParams);
+        inputs.add(inputParams1);
+        activitySpecToCreate.setInputs(inputs);
+
+        ActivitySpecParameter outputParams = new ActivitySpecParameter("status", STRING_TYPE);
+        outputParams.setValue("started");
+        List<ActivitySpecParameter> outputs = new ArrayList<>();
+        outputs.add(outputParams);
+        activitySpecToCreate.setOutputs(outputs);
+
+        activitySpecToCreate.setId("ID1");
+        activitySpecToCreate.setVersion(VERSION01);
+
+        Item item = new Item();
+        doReturn(item).when(itemManagerMock).create(anyObject());
+
+        ActivitySpecEntity activitySpec = activitySpecManager.createActivitySpec(activitySpecToCreate);
+
+        Assert.assertNotNull(activitySpec);
+        activitySpec.setId("ID1");
+        activitySpec.setStatus(VersionStatus.Draft.name());
+        assertActivitySpecEquals(activitySpec, activitySpecToCreate);
+    }
+
+
+    @Test
+    public void testList() {
+        ActivitySpecEntity activitySpec = new ActivitySpecEntity();
+        activitySpec.setName("stopServer");
+        doReturn(Arrays.asList(activitySpec)).when(itemManagerMock).list(anyObject());
+        final Collection<Item> activitySpecs = activitySpecManager.list("Certified");
+        Assert.assertEquals(activitySpecs.size(), 1);
+    }
+
+    @Test
+    public void testListInvalidFilter() {
+        final Collection<Item> activitySpecs = activitySpecManager.list("invalid_status");
+        Assert.assertEquals(activitySpecs.size(), 0);
+    }
+
+    @Test
+    public void testListNoFilter() {
+        final Collection<Item> activitySpecs = activitySpecManager.list(null);
+        Assert.assertEquals(activitySpecs.size(), 0);
+    }
+
+    @Test
+    public void testGet() {
+        input = new ActivitySpecEntity();
+        input.setId(ID);
+        input.setVersion(VERSION01);
+
+        doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
+        doReturn(input).when(activitySpecDaoMock).get(anyObject());
+        VERSION01.setStatus(VersionStatus.Draft);
+        doReturn(VERSION01).when(versionManagerMock).get(anyObject(), anyObject());
+        ActivitySpecEntity retrieved = activitySpecManager.get(input);
+        assertActivitySpecEquals(retrieved, input);
+        Assert.assertEquals(retrieved.getStatus(), VersionStatus.Draft.name());
+
+
+        input.setVersion(new Version(VERSION_ID_DEFAULT_VALUE));
+        retrieved = activitySpecManager.get(input);
+        assertActivitySpecEquals(retrieved, input);
+        Assert.assertEquals(retrieved.getStatus(), VersionStatus.Draft.name());
+    }
+
+    @Test
+    public void testGetActivitySpecDaoFail() {
+        input = new ActivitySpecEntity();
+        input.setId(ID);
+        input.setVersion(VERSION01);
+        doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
+        doReturn(input).when(activitySpecDaoMock).get(anyObject());
+        doThrow(new SdcRuntimeException(TEST_ERROR_MSG)).when(activitySpecDaoMock).get(anyObject());
+        try {
+            activitySpecManager.get(input);
+            Assert.fail();
+        } catch (ActivitySpecNotFoundException exception) {
+            Assert.assertEquals(exception.getMessage(), ACTIVITY_SPEC_NOT_FOUND);
+        }
+    }
+
+    @Test
+    public void testListVersionFail() {
+        input = new ActivitySpecEntity();
+        input.setId(ID);
+        input.setVersion(VERSION01);
+        input.getVersion().setId(VERSION_ID_DEFAULT_VALUE);
+        doThrow(new SdcRuntimeException(TEST_ERROR_MSG)).when(versionManagerMock).list(anyObject());
+        try {
+            activitySpecManager.get(input);
+            Assert.fail();
+        } catch (ActivitySpecNotFoundException exception) {
+            Assert.assertEquals(exception.getMessage(), ACTIVITY_SPEC_NOT_FOUND);
+        }
+    }
+
+    @Test
+    public void testInvalidDeprecate() {
+        try {
+            activitySpecManager.actOnAction(ID, VERSION01.getId(), ActivitySpecAction.DEPRECATE);
+        } catch (CoreException exception) {
+            Assert.assertEquals(exception.getMessage(), INVALID_STATE);
+        }
+    }
+
+    @Test
+    public void testInvalidDelete() {
+        try {
+            activitySpecManager.actOnAction(ID, VERSION01.getId(), ActivitySpecAction.DELETE);
+        } catch (CoreException exception) {
+            Assert.assertEquals(exception.getMessage(), INVALID_STATE);
+        }
+    }
+
+    @Test
+    public void testCertify() {
+        doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
+        doReturn(VERSION01).when(versionManagerMock).get(anyObject(), anyObject());
+        activitySpecManager.actOnAction(ID, VERSION01.getId(), ActivitySpecAction.CERTIFY);
+
+        verify(versionManagerMock).updateVersion(ID, VERSION01);
+        verify(itemManagerMock).updateVersionStatus(ID, VersionStatus.Certified, VersionStatus.Draft);
+        verify(versionManagerMock).publish(anyObject(), anyObject(), anyObject());
+    }
+
+    @Test
+    public void testInvalidCertify() {
+        try {
+            activitySpecManager.actOnAction(ID, VERSION01.getId(), ActivitySpecAction.CERTIFY);
+        } catch (CoreException exception) {
+            Assert.assertEquals(exception.getMessage(), INVALID_STATE);
+        }
+    }
+
+    @Test
+    public void testGetVersionFailOnStatusChangeAction() {
+        doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
+        doThrow(new SdcRuntimeException(TEST_ERROR_MSG)).when(versionManagerMock).get(anyObject(), anyObject());
+        try {
+            activitySpecManager.actOnAction(ID, VERSION01.getId(), ActivitySpecAction.CERTIFY);
+            Assert.fail();
+        } catch (ActivitySpecNotFoundException exception) {
+            Assert.assertEquals(exception.getMessage(), ACTIVITY_SPEC_NOT_FOUND);
+        }
+    }
+
+    @Test
+    public void testDeprecate() {
+        VERSION01.setStatus(VersionStatus.Certified);
+        Version retrivedVersion = new Version("12");
+        retrivedVersion.setStatus(VersionStatus.Certified);
+        doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
+        doReturn(retrivedVersion).when(versionManagerMock).get(anyObject(), anyObject());
+        activitySpecManager.actOnAction(ID, VERSION_ID_DEFAULT_VALUE, ActivitySpecAction.DEPRECATE);
+
+        verify(versionManagerMock).updateVersion(ID, retrivedVersion);
+        verify(itemManagerMock).updateVersionStatus(ID, VersionStatus.Deprecated, VersionStatus.Certified);
+        verify(versionManagerMock).publish(anyObject(), anyObject(), anyObject());
+    }
+
+    @Test
+    public void testDelete() {
+        ActivitySpecEntity activitySpec = new ActivitySpecEntity();
+        VERSION01.setStatus(VersionStatus.Deprecated);
+        activitySpec.setName("stopServer");
+        activitySpec.setVersion(VERSION01);
+
+        Version retrivedVersion = new Version("12");
+        retrivedVersion.setStatus(VersionStatus.Deprecated);
+
+        doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
+        doReturn(retrivedVersion).when(versionManagerMock).get(anyObject(), anyObject());
+        doReturn(activitySpec).when(activitySpecDaoMock).get(anyObject());
+        activitySpecManager.actOnAction(ID, VERSION_ID_DEFAULT_VALUE, ActivitySpecAction.DELETE);
+
+        verify(versionManagerMock).updateVersion(ID, VERSION01);
+        verify(itemManagerMock).updateVersionStatus(ID, VersionStatus.Deleted, VersionStatus.Deprecated);
+        verify(versionManagerMock).publish(anyObject(), anyObject(), anyObject());
+    }
+
+    private void assertActivitySpecEquals(ActivitySpecEntity actual, ActivitySpecEntity expected) {
+        Assert.assertEquals(actual.getId(), expected.getId());
+        Assert.assertEquals(actual.getName(), expected.getName());
+        Assert.assertEquals(actual.getDescription(), expected.getDescription());
+        Assert.assertEquals(actual.getCategoryList(), expected.getCategoryList());
+        Assert.assertEquals(actual.getInputs(), expected.getInputs());
+        Assert.assertEquals(actual.getOutputs(), expected.getOutputs());
+    }
+
+}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecZusammenDaoImplTest.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecZusammenDaoImplTest.java
deleted file mode 100644
index b03f454..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/be/dao/impl/ActivitySpecZusammenDaoImplTest.java
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.be.dao.impl;
-
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementConflict;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ItemVersionConflict;
-import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement;
-import com.amdocs.zusammen.commons.health.data.HealthInfo;
-import com.amdocs.zusammen.datatypes.Id;
-import com.amdocs.zusammen.datatypes.SessionContext;
-import com.amdocs.zusammen.datatypes.item.Action;
-import com.amdocs.zusammen.datatypes.item.ElementContext;
-import com.amdocs.zusammen.datatypes.item.Info;
-import com.amdocs.zusammen.datatypes.item.Item;
-import com.amdocs.zusammen.datatypes.item.ItemVersion;
-import com.amdocs.zusammen.datatypes.item.ItemVersionData;
-import com.amdocs.zusammen.datatypes.item.ItemVersionStatus;
-import com.amdocs.zusammen.datatypes.item.Resolution;
-import com.amdocs.zusammen.datatypes.itemversion.ItemVersionRevisions;
-import com.amdocs.zusammen.datatypes.itemversion.Tag;
-import java.io.InputStream;
-import org.openecomp.activityspec.be.dao.impl.ActivitySpecDaoZusammenImpl.InfoPropertyName;
-import org.openecomp.activityspec.be.datatypes.ActivitySpecData;
-import org.openecomp.activityspec.be.datatypes.ActivitySpecParameter;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.core.zusammen.api.ZusammenAdaptor;
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-import org.openecomp.activityspec.be.datatypes.ElementType;
-import org.openecomp.sdc.common.session.SessionContextProviderFactory;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.types.ElementPropertyName;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.UUID;
-import java.util.stream.Collectors;
-
-import static org.mockito.Mockito.verify;
-import static org.openecomp.core.zusammen.api.ZusammenUtil.createSessionContext;
-
-public class ActivitySpecZusammenDaoImplTest {
-
-  private static final Version version = new Version();
-  private static final String versionId = "1234";
-  private static final String itemId = "5678";
-  private static final String tenant = "dox";
-
-  ZusammenAdaptorMock zusammenAdaptor;
-  ActivitySpecDaoZusammenImpl daoImpl;
-  ActivitySpecEntity entity;
-
-
-  @BeforeMethod
-  public void setUp(){
-    SessionContextProviderFactory.getInstance().createInterface().create("test",
-        tenant);
-    zusammenAdaptor = new ZusammenAdaptorMock();
-    daoImpl = new ActivitySpecDaoZusammenImpl(zusammenAdaptor);
-    entity = new ActivitySpecEntity();
-    entity = new ActivitySpecEntity();
-
-    entity.setId(itemId);
-    version.setId(versionId);
-    entity.setVersion(version);
-    entity.setName("activitySpec");
-    List<String> categoryList = new ArrayList<String>();
-    categoryList.add("category1");
-    entity.setCategoryList(categoryList);
-    ActivitySpecParameter inputParams = new ActivitySpecParameter("dbhost", "String");
-    inputParams.setValue("localhost");
-    List<ActivitySpecParameter> inputs = new ArrayList<>();
-    inputs.add(inputParams);
-    entity.setInputs(inputs);
-  }
-
-  @AfterMethod
-  public void tearDown(){
-    SessionContextProviderFactory.getInstance().createInterface().close();
-  }
-
-  @Test
-  public void testCreate() {
-    ItemVersion itemVersionmock = new ItemVersion();
-    itemVersionmock.setId(new Id());
-
-    daoImpl.create(entity);
-    SessionContext context = createSessionContext();
-    ElementContext elementContext =
-        new ElementContext(entity.getId(), entity.getVersion().getId());
-    Optional<ElementInfo> testElementInfo =
-        zusammenAdaptor.getElementInfoByName(context, elementContext,Id.ZERO,
-            ElementType.ACTIVITYSPEC.name() );
-    Assert.assertTrue(testElementInfo.isPresent());
-    Assert.assertEquals(testElementInfo.get().getInfo().getName(), ElementType.ACTIVITYSPEC.name());
-    Assert.assertEquals(testElementInfo.get().getInfo().getProperty(
-        ActivitySpecDaoZusammenImpl.InfoPropertyName.DESCRIPTION.getValue()),
-        entity.getDescription());
-    Assert.assertEquals(testElementInfo.get().getInfo().getProperty(
-        InfoPropertyName.CATEGORY.getValue()),
-        entity.getCategoryList());
-    Assert.assertEquals(testElementInfo.get().getInfo().getProperty(
-        ActivitySpecDaoZusammenImpl.InfoPropertyName.NAME.getValue()),
-        entity.getName());
-
-    final Optional<Element> testElement = zusammenAdaptor
-        .getElement(context, elementContext, zusammenAdaptor.elementId);
-    final InputStream data = testElement.get().getData();
-    final ActivitySpecData activitySpecData = JsonUtil.json2Object(data, ActivitySpecData.class);
-    Assert.assertEquals(activitySpecData.getInputs().get(0).getName(),
-        entity.getInputs().get(0).getName());
-  }
-
-  @Test
-  public void testGet () {
-    SessionContext context = createSessionContext();
-    ElementContext elementContext =
-        new ElementContext(entity.getId(), entity.getVersion().getId());
-    final ActivitySpecEntity retrieved = daoImpl.get(entity);
-    Assert.assertEquals(retrieved.getName(), entity.getName());
-    Assert.assertEquals(retrieved.getDescription(), entity.getDescription());
-    Assert.assertEquals(retrieved.getCategoryList(), entity.getCategoryList());
-  }
-
-  @Test
-  public void testUpdate () {
-    SessionContext context = createSessionContext();
-    ElementContext elementContext =
-        new ElementContext(entity.getId(), entity.getVersion().getId());
-    entity.setDescription("Update AS version1");
-    daoImpl.update(entity);
-    final ActivitySpecEntity retrieved = daoImpl.get(entity);
-    Assert.assertEquals(retrieved.getName(), entity.getName());
-    Assert.assertEquals(retrieved.getDescription(), entity.getDescription());
-    Assert.assertEquals(retrieved.getCategoryList(), entity.getCategoryList());
-  }
-
-  private class ZusammenAdaptorMock implements ZusammenAdaptor {
-
-    private ItemVersion itemVersion;
-    private Map<String,Element> elementMap = new HashMap<>();
-    String elementId;
-
-  /*  private void setItemVersion(ItemVersion itemVersion) {
-      this.itemVersion = itemVersion;
-    }
-
-    private void addElementInfo(String key, ElementInfo elementInfo) {
-      elementInfoMap.put(key, elementInfo);
-    }
-
-    private void addElement(Element element) {
-      elements.add(element);
-    }*/
-
-    @Override
-    public Optional<ItemVersion> getFirstVersion(SessionContext context, Id itemId) {
-
-      return Optional.ofNullable(itemVersion);
-    }
-
-    @Override
-    public Collection<ItemVersion> listPublicVersions(SessionContext context, Id itemId) {
-      return null;
-    }
-
-    @Override
-    public ItemVersion getPublicVersion(SessionContext context, Id itemId, Id versionId) {
-      return null;
-    }
-
-    @Override
-    public Optional<Element> getElement(SessionContext context, ElementContext elementContext,
-                                        String elementId) {
-      return Optional.of(elementMap.get(elementId));
-    }
-
-    @Override
-    public Optional<Element> getElementByName(SessionContext context,
-                                              ElementContext elementContext,
-                                              Id parentElementId, String elementName) {
-      //return Optional.empty();
-      ZusammenElement element = new ZusammenElement();
-      Info info = new Info();
-      element.setElementId(Id.ZERO);
-      info.addProperty("name", entity.getName());
-      info.addProperty("description", entity.getDescription());
-      info.addProperty("category", entity.getCategoryList());
-      element.setInfo(info);
-      return Optional.ofNullable(element);
-    }
-
-    @Override
-    public Collection<ElementInfo> listElements(SessionContext context,
-                                                ElementContext elementContext,
-                                                Id parentElementId) {
-      return null;
-    }
-
-    @Override
-    public Collection<Element> listElementData(SessionContext context,
-                                               ElementContext elementContext,
-                                               Id parentElementId) {
-      return elementMap.values();
-    }
-
-    @Override
-    public Collection<ElementInfo> listElementsByName(SessionContext context,
-                                                      ElementContext elementContext,
-                                                      Id parentElementId, String elementName) {
-
-      return elementMap.values().stream().
-          filter(element->elementName.equals(element.getInfo().getProperty
-              (ElementPropertyName.elementType.name()))).map(element->{
-        ElementInfo elementInfo = new ElementInfo();
-        elementInfo.setId(element.getElementId());
-        elementInfo.setInfo(element.getInfo());
-        return elementInfo;
-      }).collect(Collectors.toList());
-
-    }
-
-    @Override
-    public Optional<ElementInfo> getElementInfoByName(SessionContext context,
-                                                      ElementContext elementContext,
-                                                      Id parentElementId, String elementName) {
-
-
-      return elementMap.values().stream().
-          filter(element -> elementName.equals(element.getInfo().getProperty
-              (ElementPropertyName.elementType.name()))).map(element -> {
-        ElementInfo elementInfo = new ElementInfo();
-        elementInfo.setId(element.getElementId());
-        elementInfo.setInfo(element.getInfo());
-        return elementInfo;
-      }).findAny();
-
-
-
-    }
-
-    @Override
-    public Element saveElement(SessionContext context, ElementContext elementContext,
-                               ZusammenElement element, String message) {
-      if(element.getAction().equals(Action.CREATE) ||
-          element.getAction().equals(Action.UPDATE)){
-        element.setElementId(new Id(UUID.randomUUID().toString()));
-      }
-      elementMap.put(element.getElementId().getValue(),element);
-      elementId = element.getElementId().getValue();
-      return element;
-    }
-
-    @Override
-    public void resolveElementConflict(SessionContext context, ElementContext elementContext,
-                                       ZusammenElement element, Resolution resolution) {
-
-    }
-
-    @Override
-    public Collection<HealthInfo> checkHealth(SessionContext context) {
-      return null;
-    }
-
-    @Override
-    public Id createItem(SessionContext context, Info info) {
-      return null;
-    }
-
-    @Override
-    public void updateItem(SessionContext context, Id itemId, Info info) {
-
-    }
-
-    @Override
-    public Id createVersion(SessionContext context, Id itemId, Id baseVersionId,
-                            ItemVersionData itemVersionData) {
-      return null;
-    }
-
-    @Override
-    public void updateVersion(SessionContext context, Id itemId, Id versionId,
-                              ItemVersionData itemVersionData) {
-
-    }
-
-    @Override
-    public ItemVersion getVersion(SessionContext context, Id itemId, Id versionId) {
-      return null;
-    }
-
-    @Override
-    public ItemVersionStatus getVersionStatus(SessionContext context, Id itemId, Id versionId) {
-      return null;
-    }
-
-    @Override
-    public ItemVersionConflict getVersionConflict(SessionContext context, Id itemId, Id versionId) {
-      return null;
-    }
-
-    @Override
-    public void tagVersion(SessionContext context, Id itemId, Id versionId, Tag tag) {
-
-    }
-
-    @Override
-    public void resetVersionHistory(SessionContext context, Id itemId, Id versionId,
-                                    String changeRef) {
-
-    }
-
-
-    @Override
-    public void publishVersion(SessionContext context, Id itemId, Id versionId, String message) {
-
-    }
-
-    @Override
-    public void syncVersion(SessionContext sessionContext, Id itemId, Id versionId) {
-
-    }
-
-    @Override
-    public void forceSyncVersion(SessionContext context, Id itemId, Id versionId) {
-
-    }
-
-    @Override
-    public Optional<ElementInfo> getElementInfo(SessionContext context,
-                                                ElementContext elementContext,
-                                                Id elementId) {
-      return Optional.empty();
-    }
-
-    @Override
-    public String getVersion(SessionContext sessionContext) {
-      return null;
-    }
-
-    @Override
-    public void revert(SessionContext sessionContext, Id itemId, Id versionId,
-                       Id revisionId) {
-
-    }
-
-    @Override
-    public ItemVersionRevisions listRevisions(SessionContext sessionContext, Id itemId,
-                                              Id versionId) {
-      return null;
-    }
-
-    @Override
-    public Optional<ElementConflict> getElementConflict(SessionContext context,
-                                                        ElementContext elementContext,
-                                                        Id id) {
-      return Optional.empty();
-    }
-
-    @Override
-    public Collection<Item> listItems(SessionContext context) {
-      return null;
-    }
-
-    @Override
-    public Item getItem(SessionContext context, Id itemId) {
-      return null;
-    }
-
-    @Override
-    public void deleteItem(SessionContext context, Id itemId) {
-
-    }
-
-  }
-
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/be/impl/ActivitySpecManagerImplTest.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/be/impl/ActivitySpecManagerImplTest.java
deleted file mode 100644
index e930dd9..0000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/be/impl/ActivitySpecManagerImplTest.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright © 2016-2018 European Support Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.openecomp.activityspec.be.impl;
-
-import java.util.Arrays;
-import java.util.Collection;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.Spy;
-import org.openecomp.activityspec.api.rest.types.ActivitySpecAction;
-import org.openecomp.activityspec.be.dao.ActivitySpecDao;
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-import org.openecomp.activityspec.be.datatypes.ActivitySpecParameter;
-import org.openecomp.activityspec.errors.ActivitySpecNotFoundException;
-import org.openecomp.core.dao.UniqueValueDao;
-import org.openecomp.sdc.common.errors.CoreException;
-import org.openecomp.sdc.common.errors.SdcRuntimeException;
-import org.openecomp.sdc.common.session.SessionContextProviderFactory;
-import org.openecomp.sdc.versioning.ItemManager;
-import org.openecomp.sdc.versioning.VersioningManager;
-import org.openecomp.sdc.versioning.dao.types.Version;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.types.Item;
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.verify;
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.ACTIVITY_SPEC_NOT_FOUND;
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.INVALID_STATE;
-import static org.openecomp.activityspec.utils.ActivitySpecConstant.VERSION_ID_DEFAULT_VALUE;
-
-public class ActivitySpecManagerImplTest {
-
-  private static final String STRING_TYPE = "String";
-  private static final String TEST_ERROR_MSG = "Test Error";
-  private ActivitySpecEntity input;
-  private static final Version VERSION01 = new Version("12345");
-  private static final String ID = "ID1";
-
-  @Spy
-  @InjectMocks
-  private ActivitySpecManagerImpl activitySpecManager;
-
-  @Mock
-  private ItemManager itemManagerMock;
-
-  @Mock
-  private VersioningManager versionManagerMock;
-
-  @Mock
-  private ActivitySpecDao activitySpecDaoMock;
-
-  //This is used to mock UniqueValueUtil. This should not be removed.
-  @Mock
-  private UniqueValueDao uniqueValueDaoMock;
-
-  @BeforeMethod
-  public void setUp() throws Exception {
-    MockitoAnnotations.initMocks(this);
-  }
-
-  @AfterMethod
-  public void tearDown() {
-    activitySpecManager = null;
-  }
-
-  @Test
-  public void testCreate() {
-
-    SessionContextProviderFactory.getInstance().createInterface().create("testUser", "testTenant");
-
-    ActivitySpecEntity activitySpecToCreate = new ActivitySpecEntity();
-    activitySpecToCreate.setName("startserver");
-    activitySpecToCreate.setDescription("start the server");
-    activitySpecToCreate.setVersion(VERSION01);
-
-    List<String> categoryList = new ArrayList<>();
-    categoryList.add("category1");
-    categoryList.add("category2");
-    activitySpecToCreate.setCategoryList(categoryList);
-
-    ActivitySpecParameter inputParams = new ActivitySpecParameter("dbhost", STRING_TYPE);
-    inputParams.setValue("localhost");
-    ActivitySpecParameter inputParams1 = new ActivitySpecParameter("dbname", STRING_TYPE);
-    inputParams.setValue("prod");
-    List<ActivitySpecParameter> inputs = new ArrayList<>();
-    inputs.add(inputParams);
-    inputs.add(inputParams1);
-    activitySpecToCreate.setInputs(inputs);
-
-    ActivitySpecParameter outputParams = new ActivitySpecParameter("status", STRING_TYPE);
-    outputParams.setValue("started");
-    List<ActivitySpecParameter> outputs = new ArrayList<>();
-    outputs.add(outputParams);
-    activitySpecToCreate.setOutputs(outputs);
-
-    activitySpecToCreate.setId("ID1");
-    activitySpecToCreate.setVersion(VERSION01);
-
-    Item item = new Item();
-    doReturn(item).when(itemManagerMock).create(anyObject());
-
-    ActivitySpecEntity activitySpec = activitySpecManager.createActivitySpec
-        (activitySpecToCreate);
-
-    Assert.assertNotNull(activitySpec);
-    activitySpec.setId("ID1");
-    activitySpec.setStatus(VersionStatus.Draft.name());
-    assertActivitySpecEquals(activitySpec, activitySpecToCreate);
-  }
-
-
-
-  @Test
-  public void testList () {
-    ActivitySpecEntity activitySpec = new ActivitySpecEntity();
-    activitySpec.setName("stopServer");
-    doReturn(Arrays.asList(
-        activitySpec))
-        .when(itemManagerMock).list(anyObject());
-    final Collection<Item> activitySpecs = activitySpecManager.list("Certified");
-    Assert.assertEquals(activitySpecs.size(), 1);
-  }
-
-  @Test
-  public void testListInvalidFilter () {
-    final Collection<Item> activitySpecs = activitySpecManager.list("invalid_status");
-    Assert.assertEquals(activitySpecs.size(), 0);
-  }
-
-  @Test
-  public void testListNoFilter () {
-    final Collection<Item> activitySpecs = activitySpecManager.list(null);
-    Assert.assertEquals(activitySpecs.size(), 0);
-  }
-
-  @Test
-  public void testGet () {
-    input = new ActivitySpecEntity();
-    input.setId(ID);
-    input.setVersion(VERSION01);
-
-    doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
-    doReturn(input).when(activitySpecDaoMock).get(anyObject());
-    VERSION01.setStatus(VersionStatus.Draft);
-    doReturn(VERSION01).when(versionManagerMock).get(anyObject(), anyObject());
-    ActivitySpecEntity retrieved = activitySpecManager.get(input);
-    assertActivitySpecEquals(retrieved, input);
-    Assert.assertEquals(retrieved.getStatus(), VersionStatus.Draft.name());
-
-
-    input.setVersion(new Version(VERSION_ID_DEFAULT_VALUE));
-    retrieved = activitySpecManager.get(input);
-    assertActivitySpecEquals(retrieved, input);
-    Assert.assertEquals(retrieved.getStatus(), VersionStatus.Draft.name());
-  }
-
-  @Test
-  public void testGetActivitySpecDaoFail () {
-    input = new ActivitySpecEntity();
-    input.setId(ID);
-    input.setVersion(VERSION01);
-    doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
-    doReturn(input).when(activitySpecDaoMock).get(anyObject());
-    doThrow(new SdcRuntimeException(TEST_ERROR_MSG)).when(activitySpecDaoMock).get(anyObject());
-    try {
-      activitySpecManager.get(input);
-      Assert.fail();
-    } catch (ActivitySpecNotFoundException exception) {
-      Assert.assertEquals(exception.getMessage(), ACTIVITY_SPEC_NOT_FOUND);
-    }
-  }
-
-  @Test
-  public void testListVersionFail () {
-    input = new ActivitySpecEntity();
-    input.setId(ID);
-    input.setVersion(VERSION01);
-    input.getVersion().setId(VERSION_ID_DEFAULT_VALUE);
-    doThrow(new SdcRuntimeException(TEST_ERROR_MSG)).when(versionManagerMock).list(anyObject());
-    try {
-      activitySpecManager.get(input);
-      Assert.fail();
-    } catch (ActivitySpecNotFoundException exception) {
-      Assert.assertEquals(exception.getMessage(), ACTIVITY_SPEC_NOT_FOUND);
-    }
-  }
-
-  @Test
-  public void testInvalidDeprecate () {
-    try {
-      activitySpecManager.actOnAction(ID,
-          VERSION01.getId(), ActivitySpecAction.DEPRECATE);
-    }
-    catch (CoreException exception) {
-      Assert.assertEquals(exception.getMessage(), INVALID_STATE);
-    }
-  }
-
-  @Test
-  public void testInvalidDelete () {
-    try {
-      activitySpecManager.actOnAction(ID,
-          VERSION01.getId(), ActivitySpecAction.DELETE);
-    }
-    catch (CoreException exception) {
-      Assert.assertEquals(exception.getMessage(), INVALID_STATE);
-    }
-  }
-
-  @Test
-  public void testCertify () {
-    doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
-    doReturn(VERSION01).when(versionManagerMock).get(anyObject(), anyObject());
-    activitySpecManager.actOnAction(ID,
-        VERSION01.getId(), ActivitySpecAction.CERTIFY);
-
-    verify(versionManagerMock).updateVersion(ID, VERSION01);
-    verify(itemManagerMock).updateVersionStatus(ID, VersionStatus.Certified,
-        VersionStatus.Draft);
-    verify(versionManagerMock).publish(anyObject(), anyObject(), anyObject());
-  }
-
-  @Test
-  public void testInvalidCertify () {
-    try {
-      activitySpecManager.actOnAction(ID,
-          VERSION01.getId(), ActivitySpecAction.CERTIFY);
-    }
-    catch (CoreException exception) {
-      Assert.assertEquals(exception.getMessage(), INVALID_STATE);
-    }
-  }
-
-  @Test
-  public void testGetVersionFailOnStatusChangeAction () {
-    doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
-    doThrow(new SdcRuntimeException(TEST_ERROR_MSG)).when(versionManagerMock).get(anyObject(), anyObject());
-    try {
-      activitySpecManager.actOnAction(ID,
-          VERSION01.getId(), ActivitySpecAction.CERTIFY);
-      Assert.fail();
-    } catch (ActivitySpecNotFoundException exception) {
-      Assert.assertEquals(exception.getMessage(), ACTIVITY_SPEC_NOT_FOUND);
-    }
-  }
-
-  @Test
-  public void testDeprecate () {
-    VERSION01.setStatus(VersionStatus.Certified);
-    Version retrivedVersion = new Version("12");
-    retrivedVersion.setStatus(VersionStatus.Certified);
-    doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
-    doReturn(retrivedVersion).when(versionManagerMock).get(anyObject(), anyObject());
-    activitySpecManager.actOnAction(ID,
-        VERSION_ID_DEFAULT_VALUE, ActivitySpecAction.DEPRECATE);
-
-    verify(versionManagerMock).updateVersion(ID, retrivedVersion);
-    verify(itemManagerMock).updateVersionStatus(ID, VersionStatus.Deprecated,
-        VersionStatus.Certified);
-    verify(versionManagerMock).publish(anyObject(), anyObject(), anyObject());
-  }
-
-  @Test
-  public void testDelete () {
-    ActivitySpecEntity activitySpec = new ActivitySpecEntity();
-    VERSION01.setStatus(VersionStatus.Deprecated);
-    activitySpec.setName("stopServer");
-    activitySpec.setVersion(VERSION01);
-
-    Version retrivedVersion = new Version("12");
-    retrivedVersion.setStatus(VersionStatus.Deprecated);
-
-    doReturn(Arrays.asList(VERSION01)).when(versionManagerMock).list(anyObject());
-    doReturn(retrivedVersion).when(versionManagerMock).get(anyObject(), anyObject());
-    doReturn(activitySpec).when(activitySpecDaoMock).get(anyObject());
-    activitySpecManager.actOnAction(ID,
-        VERSION_ID_DEFAULT_VALUE, ActivitySpecAction.DELETE);
-
-    verify(versionManagerMock).updateVersion(ID, VERSION01);
-    verify(itemManagerMock).updateVersionStatus(ID, VersionStatus.Deleted,
-        VersionStatus.Deprecated);
-    verify(versionManagerMock).publish(anyObject(), anyObject(), anyObject());
-  }
-
-  private void assertActivitySpecEquals(ActivitySpecEntity actual, ActivitySpecEntity expected) {
-    Assert.assertEquals(actual.getId(), expected.getId());
-    Assert.assertEquals(actual.getName(), expected.getName());
-    Assert.assertEquals(actual.getDescription(), expected.getDescription());
-    Assert.assertEquals(actual.getCategoryList(), expected.getCategoryList());
-    Assert.assertEquals(actual.getInputs(), expected.getInputs());
-    Assert.assertEquals(actual.getOutputs(), expected.getOutputs());
-  }
-
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-war/pom.xml b/services/activity-spec/activity-spec-web/activity-spec-war/pom.xml
index 7d9c2c7..fa2092a 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-war/pom.xml
+++ b/services/activity-spec/activity-spec-web/activity-spec-war/pom.xml
@@ -8,7 +8,7 @@
     <packaging>war</packaging>
 
     <parent>
-        <groupId>org.openecomp.activityspec</groupId>
+        <groupId>org.onap.sdc.activityspec</groupId>
         <artifactId>activity-spec</artifactId>
         <version>1.2.0-SNAPSHOT</version>
         <relativePath>../..</relativePath>
@@ -16,7 +16,7 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.openecomp.activityspec</groupId>
+            <groupId>org.onap.sdc.activityspec</groupId>
             <artifactId>activity-spec-service</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -53,7 +53,7 @@
                     <apiSources>
                         <apiSource>
                             <springmvc>false</springmvc>
-                            <locations>org.openecomp.activityspec</locations>
+                            <locations>org.onap.sdc.activityspec</locations>
                             <schemes>http</schemes>
                             <basePath>/activity-spec-api</basePath>
                             <info>
diff --git a/services/activity-spec/activity-spec-web/activity-spec-war/src/main/webapp/WEB-INF/beans-services.xml b/services/activity-spec/activity-spec-web/activity-spec-war/src/main/webapp/WEB-INF/beans-services.xml
index 11bf984..245f3b8 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-war/src/main/webapp/WEB-INF/beans-services.xml
+++ b/services/activity-spec/activity-spec-web/activity-spec-war/src/main/webapp/WEB-INF/beans-services.xml
@@ -2,11 +2,9 @@
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:jaxrs="http://cxf.apache.org/jaxrs"
-       xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
-       http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
-       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+       http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
 
 
     <import resource="classpath:META-INF/cxf/cxf.xml"/>
@@ -27,7 +25,7 @@
 
     <!-- aspect beans -->
     <bean id = "activitySpecs"
-          class="org.openecomp.activityspec.api.rest.services.ActivitySpecsImpl"/>
+          class="org.onap.sdc.activityspec.api.rest.services.ActivitySpecsImpl"/>
 
     <!-- RESTful Services -->
     <jaxrs:server id="restContainer" address="/">
@@ -38,7 +36,7 @@
 
         <jaxrs:providers>
             <ref bean="jsonProvider"/>
-            <bean class="org.openecomp.activityspec.errors.DefaultExceptionMapper"/>
+            <bean class="org.onap.sdc.activityspec.errors.DefaultExceptionMapper"/>
             <bean class="org.openecomp.sdc.logging.servlet.jaxrs.LoggingRequestFilter">
                 <property name="requestIdHeaders" value="X-ECOMP-RequestID,X-ONAP-RequestID"/>
                 <property name="partnerNameHeaders" value="USER_ID"/>
diff --git a/services/activity-spec/activity-spec-web/activity-spec-war/src/main/webapp/WEB-INF/web.xml b/services/activity-spec/activity-spec-web/activity-spec-war/src/main/webapp/WEB-INF/web.xml
index 0a78e8e..229ef9f 100644
--- a/services/activity-spec/activity-spec-web/activity-spec-war/src/main/webapp/WEB-INF/web.xml
+++ b/services/activity-spec/activity-spec-web/activity-spec-war/src/main/webapp/WEB-INF/web.xml
@@ -12,12 +12,12 @@
     </context-param>
 
     <listener>
-        <listener-class>org.openecomp.activityspec.api.server.listeners.ActivitySpecAppStartupListener</listener-class>
+        <listener-class>org.onap.sdc.activityspec.api.server.listeners.ActivitySpecAppStartupListener</listener-class>
     </listener>
 
     <filter>
         <filter-name>SessionContextFilter</filter-name>
-        <filter-class>org.openecomp.activityspec.api.server.filters.ActivitySpecSessionContextFilter</filter-class>
+        <filter-class>org.onap.sdc.activityspec.api.server.filters.ActivitySpecSessionContextFilter</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>SessionContextFilter</filter-name>
diff --git a/services/activity-spec/activity-spec-web/pom.xml b/services/activity-spec/activity-spec-web/pom.xml
index 799c9d2..a1df977 100644
--- a/services/activity-spec/activity-spec-web/pom.xml
+++ b/services/activity-spec/activity-spec-web/pom.xml
@@ -7,7 +7,7 @@
     <packaging>pom</packaging>
 
     <parent>
-        <groupId>org.openecomp.activityspec</groupId>
+        <groupId>org.onap.sdc.activityspec</groupId>
         <artifactId>activity-spec</artifactId>
         <version>1.2.0-SNAPSHOT</version>
     </parent>
diff --git a/services/activity-spec/pom.xml b/services/activity-spec/pom.xml
index 72b3bf5..fddf230 100644
--- a/services/activity-spec/pom.xml
+++ b/services/activity-spec/pom.xml
@@ -4,7 +4,7 @@
 
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>org.openecomp.activityspec</groupId>
+    <groupId>org.onap.sdc.activityspec</groupId>
     <artifactId>activity-spec</artifactId>
     <version>1.2.0-SNAPSHOT</version>
     <packaging>pom</packaging>
