diff options
author | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-03-15 16:16:21 -0400 |
---|---|---|
committer | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-03-15 23:13:44 -0400 |
commit | 853440d183783ebfe65f45b49ad8874d9c87ef8d (patch) | |
tree | e3359e5173543a684140bf05962478df6f6f3567 /bpmn/so-bpmn-building-blocks/src/test/java | |
parent | 4ca3abdffa40e7777a233151f66ee0b4131ed538 (diff) |
Add VnfInPlaceSoftwareUpdate for WFD
Added CheckPserversLocked,SetClosedLoopDisabled,UnsetClosedLoopDisabled, CheckClosedLoopDisabled, CheckInMain
Change-Id: I6405b2c88d2109d952d452648bef2f99be6993df
Issue-ID: SO-1518
Signed-off-by: Bonkur, Venkat (vb8416) <vb8416@att.com>
Diffstat (limited to 'bpmn/so-bpmn-building-blocks/src/test/java')
5 files changed, 275 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java new file mode 100644 index 0000000000..ac4499bf89 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckClosedLoopDisabledFlagActivityTest.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.bpmn.subprocess; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doThrow; + +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.junit.Test; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.BaseBPMNTest; + +public class VNFCheckClosedLoopDisabledFlagActivityTest extends BaseBPMNTest{ + @Test + public void sunnyDayVNFCheckClosedLoopDisabledFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckClosedLoopDisabledFlagActivity_Start", + "TaskCheckClosedLoopDisabledFlagActivity", + "VNFCheckClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFCheckClosedLoopDisabledFlagActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .checkVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckClosedLoopDisabledFlagActivity_Start", + "TaskCheckClosedLoopDisabledFlagActivity").hasNotPassed( + "VNFCheckClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } + +} diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java new file mode 100644 index 0000000000..050d3124f6 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckInMaintFlagActivityTest.java @@ -0,0 +1,56 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.bpmn.subprocess; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doThrow; + +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.junit.Test; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.BaseBPMNTest; + + +public class VNFCheckInMaintFlagActivityTest extends BaseBPMNTest{ + @Test + public void sunnyDayVNFCheckInMaintFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckInMaintFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckInMaintFlagActivity_Start", + "TaskCheckInMaintFlag", + "VNFCheckInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFCheckInMaintFlagActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .checkVnfInMaintFlag(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckInMaintFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckInMaintFlagActivity_Start", + "TaskCheckInMaintFlag").hasNotPassed( + "VNFCheckInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } + +} diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java new file mode 100644 index 0000000000..e43f47fa6a --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFCheckPserversLockedFlagActivity.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.bpmn.subprocess; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doThrow; + +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.junit.Test; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.BaseBPMNTest; + +public class VNFCheckPserversLockedFlagActivity extends BaseBPMNTest{ + @Test + public void sunnyDayVNFCheckInMaintFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckPserversLockedFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckPserversLockedFlagActivity_Start", + "TaskCheckPserversLockedFlagActivity", + "VNFCheckPserversLockedFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFCheckPserversLockedFlagActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .checkVnfPserversLockedFlag(any(BuildingBlockExecution.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFCheckPserversLockedFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFCheckPserversLockedFlagActivity_Start", + "TaskCheckPserversLockedFlagActivity").hasNotPassed( + "VNFCheckPserversLockedFlagActivity_End"); + assertThat(pi).isEnded(); + } + +} diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java new file mode 100644 index 0000000000..8e56051f47 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFSetClosedLoopDisabledFlagActivityTest.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.bpmn.subprocess; +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.assertThat; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doThrow; + +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.junit.Test; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.BaseBPMNTest; + +public class VNFSetClosedLoopDisabledFlagActivityTest extends BaseBPMNTest{ + @Test + public void sunnyDayVNFSetClosedLoopDisabledFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFSetClosedLoopDisabledFlagActivity_Start", + "TaskSetClosedLoopDisabledFlagActivity", + "VNFSetClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFSetClosedLoopDisabledFlagActivity_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .modifyVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class), any(boolean.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFSetClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFSetClosedLoopDisabledFlagActivity_Start", + "TaskSetClosedLoopDisabledFlagActivity").hasNotPassed( + "VNFSetInMaintFlagActivity_End"); + assertThat(pi).isEnded(); + } +} diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java new file mode 100644 index 0000000000..4c9b33c2c7 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/VNFUnsetClosedLoopDisabledFlagActivityTest.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.bpmn.subprocess; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doThrow; + +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.junit.Test; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.BaseBPMNTest; + +public class VNFUnsetClosedLoopDisabledFlagActivityTest extends BaseBPMNTest{ + @Test + public void sunnyDayVNFUnsetClosedLoopDisabledFlagActivity_Test() throws InterruptedException { + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetClosedLoopDisabledFlagActivity_Start", + "TaskVNFUnsetClosedLoopDisabledFlagActivity", + "VNFUnsetClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } + + @Test + public void rainyDayVNFUnsetClosedLoopFlag_Test() throws Exception { + doThrow(new BpmnError("7000", "TESTING ERRORS")).when(aaiFlagTasks) + .modifyVnfClosedLoopDisabledFlag(any(BuildingBlockExecution.class), any(boolean.class)); + ProcessInstance pi = runtimeService.startProcessInstanceByKey("VNFUnsetInClosedLoopDisabledFlagActivity", variables); + assertThat(pi).isNotNull(); + assertThat(pi).isStarted().hasPassedInOrder("VNFUnsetClosedLoopDisabledFlagActivity_Start", + "TaskVNFUnsetClosedLoopDisabledFlagActivity").hasNotPassed( + "VNFUnsetClosedLoopDisabledFlagActivity_End"); + assertThat(pi).isEnded(); + } +} |