blob: 1cfdd886636d560431813a044f19025796d7f4f3 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
package org.onap.simulator.presetGenerator.presets.BasePresets;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import java.util.Map;
import vid.automation.test.infra.Features;
public abstract class BaseMSOPreset extends BasePreset {
public static final String DEFAULT_CLOUD_OWNER = "irma-aic";
public static final String DEFAULT_INSTANCE_ID = "f8791436-8d55-4fde-b4d5-72dd2cf13cfb";
protected String cloudOwner = DEFAULT_CLOUD_OWNER;
public static String getRequestBodyWithTestApiOnly() {
if (Features.FLAG_ADD_MSO_TESTAPI_FIELD.isActive()) {
return "" +
"{" +
" \"requestDetails\": { " +
" \"requestParameters\": { " +
" \"testApi\": \"VNF_API\" " +
" } " +
" } " +
"} " +
"";
} else {
return null;
}
}
protected String addCloudOwnerIfNeeded() {
return Features.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST.isActive() ?
"\"cloudOwner\": \"" + cloudOwner + "\"," : "";
}
protected String addPlatformIfNeeded(String platform) {
return isNotEmpty(platform) ?
" \"platform\": {" +
" \"platformName\": \"" + platform + "\"," +
"}," : "";
}
@Override
protected String getRootPath() {
return "/mso";
}
@Override
public Map<String, String> getRequestHeaders() {
Map<String, String> map = super.getRequestHeaders();
map.put("X-ONAP-PartnerName", "VID.VID");
map.put("X-ECOMP-RequestID", "[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}");
return map;
}
}
|