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>
