c1c7f06d4e6182163c54f5e5a44ab98c17b1bfc0
[so.git] /
1 package org.onap.so.bpmn.infrastructure.pnf.delegate;
2
3 import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.*;
4 import org.camunda.bpm.engine.delegate.DelegateExecution;
5 import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
6 import java.util.UUID;
7
8
9 public class PnfInputCheckersTestUtils {
10
11     static final String PNF_ENTRY_NOTIFICATION_TIMEOUT = "P1D";
12     static final String VALID_UUID = UUID.nameUUIDFromBytes("testUuid".getBytes()).toString();
13     static final String RESERVED_UUID = new UUID(0, 0).toString();
14     private static final String DEFAULT_SERVICE_INSTANCE_ID = "da7d07d9-b71c-4128-809d-2ec01c807169";
15     private static final String DEFAULT_PNF_CORRELATION_ID = "testPnfCorrelationId";
16
17     static class DelegateExecutionBuilder {
18         private String pnfCorrelationId = DEFAULT_PNF_CORRELATION_ID;
19         private String pnfUuid = VALID_UUID;
20         private String serviceInstanceId = DEFAULT_SERVICE_INSTANCE_ID;
21
22         public DelegateExecutionBuilder setPnfCorrelationId(String pnfCorrelationId) {
23             this.pnfCorrelationId = pnfCorrelationId;
24             return this;
25         }
26
27         public DelegateExecutionBuilder setPnfUuid(String pnfUuid) {
28             this.pnfUuid = pnfUuid;
29             return this;
30         }
31
32         public DelegateExecutionBuilder setServiceInstanceId(String serviceInstanceId) {
33             this.serviceInstanceId = serviceInstanceId;
34             return this;
35         }
36
37         public DelegateExecution build() {
38             DelegateExecution execution = new DelegateExecutionFake();
39             execution.setVariable("testProcessKey", "testProcessKeyValue");
40             execution.setVariable(PNF_CORRELATION_ID, this.pnfCorrelationId);
41             execution.setVariable(PNF_UUID, this.pnfUuid);
42             execution.setVariable(SERVICE_INSTANCE_ID, this.serviceInstanceId);
43             return execution;
44         }
45     }
46 }