diff options
author | 2018-03-26 15:23:57 +0530 | |
---|---|---|
committer | 2018-03-27 08:56:33 +0000 | |
commit | 4a065a54483b0d64e2bb2b54c82f167e28d4dcf8 (patch) | |
tree | c8f8d4a1d2b70ef417b67592096ae9f285c89063 /services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/VersionManagerMock.java | |
parent | 56e56b8860cf6e7ad70dc65134e8fd87eaf01123 (diff) |
Activity Spec Service - Refactor unit test
Resolve review comments
Refactor unit test. Remove mock classes.
Change-Id: I9185121e84c2d9337db3b35b9156d328bf0e0d8c
Issue-ID: SDC-1048
Signed-off-by: sheetalm <sheetal.mudholkar@amdocs.com>
Diffstat (limited to 'services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/VersionManagerMock.java')
-rw-r--r-- | services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/VersionManagerMock.java | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/VersionManagerMock.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/VersionManagerMock.java deleted file mode 100644 index 4b1deb3741..0000000000 --- a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/VersionManagerMock.java +++ /dev/null @@ -1,105 +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.mocks; - -import org.openecomp.sdc.versioning.VersioningManager; -import org.openecomp.sdc.versioning.dao.types.Revision; -import org.openecomp.sdc.versioning.dao.types.Version; -import org.openecomp.sdc.versioning.dao.types.VersionStatus; -import org.openecomp.sdc.versioning.types.VersionCreationMethod; - -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Certified; -import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Deprecated; -import static org.openecomp.sdc.versioning.dao.types.VersionStatus.Deleted; - -public class VersionManagerMock implements VersioningManager { - - private String id; - private Version version; - - - @Override - public List<Version> list(String itemId) { - List<Version> versions = new ArrayList<Version>(); - versions.add(version); - return versions; - } - - - @Override - public Version get(String itemId, Version version) { - return this.version; - } - - @Override - public Version create(String itemId, Version version, VersionCreationMethod creationMethod) { - this.id = UUID.randomUUID().toString(); - version.setId(this.id); - version.setStatus(VersionStatus.Draft); - this.version = version; - - return version; - } - - @Override - public void submit(String itemId, Version version, String submitDescription) { - - } - - - @Override - public void publish(String itemId, Version version, String message) { - - } - - @Override - public void sync(String itemId, Version version) { - - } - - @Override - public void forceSync(String itemId, Version version) { - - } - - @Override - public void revert(String itemId, Version version, String revisionId) { - - } - - @Override - public List<Revision> listRevisions(String itemId, Version version) { - return null; - } - - @Override - public void updateVersion(String itemId, Version version) { - if (version.getStatus() == Certified) { - this.version.setStatus(Certified); - } - if (version.getStatus() == Deprecated) { - this.version.setStatus(Deprecated); - } - if (version.getStatus() == Deleted) { - this.version.setStatus(Deleted); - } - } -} |