Containerization feature of SO
[so.git] / bpmn / mso-infrastructure-bpmn / src / test / java / org / onap / so / bpmn / common / RainyDayHandlerIT.java
1 /*- 
2  * ============LICENSE_START======================================================= 
3  * ONAP - SO 
4  * ================================================================================ 
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. 
6  * ================================================================================ 
7  * Licensed under the Apache License, Version 2.0 (the "License"); 
8  * you may not use this file except in compliance with the License. 
9  * You may obtain a copy of the License at 
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0 
12  * 
13  * Unless required by applicable law or agreed to in writing, software 
14  * distributed under the License is distributed on an "AS IS" BASIS, 
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
16  * See the License for the specific language governing permissions and 
17  * limitations under the License. 
18  * ============LICENSE_END========================================================= 
19  */ 
20
21 package org.onap.so.bpmn.common;
22
23 import static org.onap.so.bpmn.mock.StubResponsePolicy.MockPolicyAbort;
24
25 import java.util.HashMap;
26 import java.util.Map;
27 import java.util.UUID;
28
29 import org.junit.Assert;
30 import org.junit.Test;
31 import org.onap.so.BaseIntegrationTest;
32
33 /**
34  * Unit test for RainyDayHandler.bpmn.
35  */
36
37 public class RainyDayHandlerIT extends BaseIntegrationTest {
38         
39         @Test   
40         
41         public void  TestRainyDayHandlingSuccess() {
42
43                 Map<String, Object> variables = new HashMap<>();
44                 variables.put("isDebugLogEnabled","true");
45                 variables.put("msoRequestId", "testRequestId");
46                 variables.put("serviceType", "X");
47                 variables.put("vnfType", "Y");
48                 variables.put("currentActivity", "BB1");                
49                 variables.put("workStep", "1");
50                 variables.put("failedActivity", "");
51                 variables.put("errorCode", "123");
52                 variables.put("errorText", "update failed");
53                 variables.put("vnfName", "vSAMP1");
54                 
55                 MockPolicyAbort();
56                 
57                 
58                 String businessKey = UUID.randomUUID().toString();
59                 invokeSubProcess("RainyDayHandler", businessKey, variables);
60
61                 waitForProcessEnd(businessKey, 10000);
62
63                 Assert.assertTrue(isProcessEnded(businessKey));
64                 
65         }
66
67         
68         
69 }