summaryrefslogtreecommitdiffstats
path: root/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks
diff options
context:
space:
mode:
Diffstat (limited to 'services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks')
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/ActivitySpecDaoMock.java39
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/ItemManagerMock.java86
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/UniqueValueDaoMock.java49
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/VersionManagerMock.java105
4 files changed, 0 insertions, 279 deletions
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/ActivitySpecDaoMock.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/ActivitySpecDaoMock.java
deleted file mode 100644
index 4e21435900..0000000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/ActivitySpecDaoMock.java
+++ /dev/null
@@ -1,39 +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.activityspec.be.dao.ActivitySpecDao;
-import org.openecomp.activityspec.be.dao.types.ActivitySpecEntity;
-
-public class ActivitySpecDaoMock implements ActivitySpecDao {
- public ActivitySpecEntity activitySpec;
-
- @Override
- public void create(ActivitySpecEntity activitySpecEntity) {
- activitySpec = activitySpecEntity;
- }
-
- @Override
- public ActivitySpecEntity get(ActivitySpecEntity activitySpecEntity) {
- return activitySpec;
- }
-
- @Override
- public void update(ActivitySpecEntity activitySpecEntity) {
- activitySpec = activitySpecEntity;
- }
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/ItemManagerMock.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/ItemManagerMock.java
deleted file mode 100644
index 060e29ccb1..0000000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/ItemManagerMock.java
+++ /dev/null
@@ -1,86 +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 java.util.ArrayList;
-import java.util.List;
-import org.openecomp.sdc.versioning.dao.types.VersionStatus;
-import org.openecomp.sdc.versioning.types.Item;
-import org.openecomp.sdc.versioning.ItemManager;
-import java.util.Collection;
-import java.util.UUID;
-import java.util.function.Predicate;
-
-public class ItemManagerMock implements ItemManager {
-
- private String id;
- private Item item;
-
-
- @Override
- public Collection<Item> list(Predicate<Item> predicate) {
- List<Item> items = new ArrayList<>();
- items.add(item);
- return items;
- }
-
- @Override
- public Item get(String itemId) {
- return null;
- }
-
- @Override
- public Item create(Item item) {
- this.id = UUID.randomUUID().toString();
- item.setId(this.id);
- this.item = item;
- return item;
- }
-
- @Override
- public void updateVersionStatus(String itemId, VersionStatus addedVersionStatus,
- VersionStatus removedVersionStatus) {
- // noop
- }
-
- @Override
- public void archive(Item item) {
- // noop
- }
-
- public void restore(Item item) {
- // noop
- }
-
-
- @Override
- public void updateName(String itemId, String name) {
- // noop
- }
-
- @Override
- public void update(Item item) {
- // noop
- }
-
- @Override
- public void delete(Item item) {
- // noop
- }
-
-}
diff --git a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/UniqueValueDaoMock.java b/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/UniqueValueDaoMock.java
deleted file mode 100644
index 675c3b1878..0000000000
--- a/services/activity-spec/activity-spec-web/activity-spec-service/src/test/java/org/openecomp/activityspec/mocks/UniqueValueDaoMock.java
+++ /dev/null
@@ -1,49 +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.core.dao.UniqueValueDao;
-import org.openecomp.core.dao.types.UniqueValueEntity;
-
-import java.util.Collection;
-
-public class UniqueValueDaoMock implements UniqueValueDao {
- @Override
- public Collection<UniqueValueEntity> list(UniqueValueEntity entity) {
- return null;
- }
-
- @Override
- public void create(UniqueValueEntity entity) {
-
- }
-
- @Override
- public void update(UniqueValueEntity entity) {
-
- }
-
- @Override
- public UniqueValueEntity get(UniqueValueEntity entity) {
- return null;
- }
-
- @Override
- public void delete(UniqueValueEntity entity) {
-
- }
-}
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);
- }
- }
-}