aboutsummaryrefslogtreecommitdiffstats
path: root/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java
blob: c1ba8125130fb6d072642dfb28e0d4b10a1b59b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package org.onap.so.simulator.scenarios.sdnc.grapi;

import com.consol.citrus.actions.AbstractTestAction;
import com.consol.citrus.context.TestContext;

public class ProcessSDNCAssignService extends AbstractTestAction {


    @Override
    public void doExecute(TestContext context) {
        try {
            String serviceName = context.getVariable("serviceName");
            String action = context.getVariable("action");
            if (("Robot_SI_For_Service_Failure".equals(serviceName) && "assign".equals(action))
                    || ("Robot_SI_For_Service_Rollback_Failure".equals(serviceName))) {
                context.setVariable("responseMessage", "SDNC is throwing errors");
                context.setVariable("responseCode", "500");
            } else {
                context.setVariable("responseMessage", "Success");
                context.setVariable("responseCode", "200");
            }

        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}