},
{
"key": "username",
- "value": "healthcheck",
+ "value": "runtimeUser",
"type": "string"
}
]
},
{
"key": "username",
- "value": "healthcheck",
+ "value": "runtimeUser",
"type": "string"
}
]
},
{
"key": "username",
- "value": "healthcheck",
+ "value": "runtimeUser",
"type": "string"
}
]
},
{
"key": "username",
- "value": "healthcheck",
+ "value": "runtimeUser",
"type": "string"
}
]
},
{
"key": "username",
- "value": "healthcheck",
+ "value": "runtimeUser",
"type": "string"
}
]
},
{
"key": "username",
- "value": "healthcheck",
+ "value": "runtimeUser",
"type": "string"
}
]
"restServerParameters": {
"host": "0.0.0.0",
"port": 6968,
- "userName": "healthcheck",
+ "userName": "policyadmin",
"password": "zb!XztG34",
"https": false,
"aaf": false
"restServerParameters": {
"host": "0.0.0.0",
"port": 6969,
- "userName": "healthcheck",
+ "userName": "runtimeUser",
"password": "zb!XztG34",
"https": false,
"aaf": false
"auth": {
"type": "basic",
"basic": {
- "username": "healthcheck",
+ "username": "runtimeUser",
"password": "zb!XztG34"
}
}
"auth": {
"type": "basic",
"basic": {
- "username": "healthcheck",
+ "username": "runtimeUser",
"password": "zb!XztG34"
}
}
"auth": {
"type": "basic",
"basic": {
- "username": "healthcheck",
+ "username": "runtimeUser",
"password": "zb!XztG34"
}
}
clientName: api
hostname: policy-api
port: 6969
- userName: healthcheck
+ userName: policyadmin
password: zb!XztG34
useHttps: true
allowSelfSignedCerts: true
clientName: pap
hostname: policy-pap
port: 6969
- userName: healthcheck
+ userName: policyadmin
password: zb!XztG34
useHttps: true
allowSelfSignedCerts: true
clientName: api
hostname: policy-api
port: 6969
- userName: healthcheck
+ userName: policyadmin
password: zb!XztG34
useHttps: true
allowSelfSignedCerts: true
clientName: pap
hostname: policy-pap
port: 6969
- userName: healthcheck
+ userName: policyadmin
password: zb!XztG34
useHttps: true
allowSelfSignedCerts: true
map.put("clientName", "pap");
map.put("hostname", "localhost");
map.put("port", 6968);
- map.put("userName", "healthcheck");
+ map.put("userName", "policyadmin");
map.put("password", "zb!XztG34");
map.put("https", false);
map.put("allowSelfSignedCerts", true);
map.put("clientName", "api");
map.put("hostname", "localhost");
map.put("port", 6969);
- map.put("userName", "healthcheck");
+ map.put("userName", "policyadmin");
map.put("password", "zb!XztG34");
map.put("https", false);
map.put("allowSelfSignedCerts", true);
participant.policyApiParameters.clientName=api
participant.policyApiParameters.hostname=localhost
participant.policyApiParameters.port=6969
-participant.policyApiParameters.userName=healthcheck
+participant.policyApiParameters.userName=policyadmin
participant.policyApiParameters.password=zb!XztG34
participant.policyApiParameters.https=false
participant.policyApiParameters.allowSelfSignedCerts=true
spring:
security:
user:
- name: healthcheck
+ name: runtimeUser
password: zb!XztG34
server:
-spring.security.user.name=healthcheck
+spring.security.user.name=runtimeUser
spring.security.user.password=zb!XztG34
server.servlet.context-path=/onap/participantsim
participant.restServerParameters.host=0.0.0.0
participant.restServerParameters.port=6969
-participant.restServerParameters.userName=healthcheck
+participant.restServerParameters.userName=runtimeUser
participant.restServerParameters.password=zb!XztG34
participant.restServerParameters.https=false
participant.restServerParameters.aaf=false
#
# Configuration Settings for Policy Engine Components
clamp.config.policy.api.url=http://localhost:8085
-clamp.config.policy.api.userName=healthcheck
+clamp.config.policy.api.userName=policyadmin
clamp.config.policy.api.password=zb!XztG34
clamp.config.policy.pap.url=http://localhost:8085
-clamp.config.policy.pap.userName=healthcheck
+clamp.config.policy.pap.userName=policyadmin
clamp.config.policy.pap.password=zb!XztG34
#
# Configuration settings for ControlLoop Runtime Rest API
clamp.config.controlloop.runtime.url=http://localhost:6969
-clamp.config.controlloop.runtime.userName=healthcheck
+clamp.config.controlloop.runtime.userName=runtimeUser
clamp.config.controlloop.runtime.password=zb!XztG34
#
# Configuration Settings for Policy Engine Components
clamp.config.policy.api.url=http://policy.api.simpledemo.onap.org:6969
-clamp.config.policy.api.userName=healthcheck
+clamp.config.policy.api.userName=policyadmin
clamp.config.policy.api.password=zb!XztG34
clamp.config.policy.pap.url=http://policy.api.simpledemo.onap.org:6969
-clamp.config.policy.pap.userName=healthcheck
+clamp.config.policy.pap.userName=policyadmin
clamp.config.policy.pap.password=zb!XztG34
#
# Configuration settings for ControlLoop Runtime Rest API
clamp.config.controlloop.runtime.url=http://localhost:6969
-clamp.config.controlloop.runtime.userName=healthcheck
+clamp.config.controlloop.runtime.userName=runtimeUser
clamp.config.controlloop.runtime.password=zb!XztG34
*/
@Test
public void testGetStringValue() {
- assertEquals("healthcheck", refProp.getStringValue("policy.api.userName"));
+ assertEquals("policyadmin", refProp.getStringValue("policy.api.userName"));
}
/**
private static final String DIRECT_GET_TOSCA_INSTANTIATION = "direct:get-tosca-instantiation";
+ private static final String DIRECT_POST_TOSCA_INSTANTANCE_PROPERTIES = "direct:post-tosca-instance-properties";
+
private static final String SERVICE_TEMPLATE_NAME = "name";
private static final String SERVICE_TEMPLATE_VERSION = "version";
+ "\"version\": \"1.0.1\",\"definition\": {},\"state\": \"UNINITIALISED\",\"orderedState\": \"UNINITIALISED\","
+ "\"description\": \"PMSH control loop instance 0\",\"elements\": {}}]}";
+ private static final String SAMPLE_TOSCA_TEMPLATE =
+ "{\"tosca_definitions_version\": \"tosca_simple_yaml_1_1_0\","
+ + "\"data_types\": {},\"node_types\": {}, \"policy_types\": {},"
+ + " \"topology_template\": {},"
+ + " \"name\": \"ToscaServiceTemplateSimple\", \"version\": \"1.0.0\", \"metadata\": {}}";
+
@Test
public void testToscaServiceTemplateStatus() {
ProducerTemplate prodTemplate = camelContext.createProducerTemplate();
assertThat(HttpStatus.valueOf((Integer) exchangeResponse.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE))
.is2xxSuccessful()).isTrue();
}
+
+ @Test
+ public void testCommissioningOfToscaServiceTemplateStatus() {
+ ProducerTemplate prodTemplate = camelContext.createProducerTemplate();
+
+ Exchange exchangeResponse =
+ prodTemplate.send(DIRECT_POST_TOSCA_INSTANTANCE_PROPERTIES, ExchangeBuilder.anExchange(camelContext)
+ .withBody(SAMPLE_TOSCA_TEMPLATE)
+ .withProperty("raiseHttpExceptionFlag", "true")
+ .build());
+
+ assertThat(HttpStatus.valueOf((Integer) exchangeResponse.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE))
+ .is2xxSuccessful()).isTrue();
+ }
}
#
# Configuration Settings for Policy Engine Components
clamp.config.policy.api.url=http://localhost:${docker.http-cache.port.host}
-clamp.config.policy.api.userName=healthcheck
+clamp.config.policy.api.userName=policyadmin
clamp.config.policy.api.password=zb!XztG34
clamp.config.policy.pap.url=http://localhost:${docker.http-cache.port.host}
-clamp.config.policy.pap.userName=healthcheck
+clamp.config.policy.pap.userName=policyadmin
clamp.config.policy.pap.password=zb!XztG34
# Sdc service properties
# Configuration settings for ControlLoop Runtime Rest API
clamp.config.controlloop.runtime.url=http://localhost:${docker.http-cache.port.host}
-clamp.config.controlloop.runtime.userName=healthcheck
+clamp.config.controlloop.runtime.userName=runtimeUser
clamp.config.controlloop.runtime.password=zb!XztG34
jsonGenerated = "{\"controlLoopList\": [{\"name\": \"PMSHInstance0\",\"version\": \"1.0.1\",\"definition\": {},\"state\": \"UNINITIALISED\",\"orderedState\": \"UNINITIALISED\",\"description\": \"PMSH control loop instance 0\",\"elements\": {}}]}";
self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content)
return True
+ elif (self.path.startswith("/onap/controlloop/v2/instanceProperties")) and http_type == "POST":
+ print("self.path start with POST /onap/controlloop/v2/instanceProperties, copying body to response ...")
+ if not os.path.exists(cached_file_folder):
+ os.makedirs(cached_file_folder, 0o777)
+ with open(cached_file_header, 'w+') as f:
+ f.write("{\"Content-Length\": \"" + str(len(self.data_string)) + "\", \"Content-Type\": \""+str(self.headers['Content-Type'])+"\"}")
+ with open(cached_file_content, 'w+') as f:
+ f.write(self.data_string)
+ return True
else:
return False
#
# Configuration Settings for Policy Engine Components
clamp.config.policy.api.url=http://localhost:${docker.http-cache.port.host}
-clamp.config.policy.api.userName=healthcheck
+clamp.config.policy.api.userName=policyadmin
clamp.config.policy.api.password=zb!XztG34
clamp.config.policy.pap.url=http://localhost:${docker.http-cache.port.host}
-clamp.config.policy.pap.userName=healthcheck
+clamp.config.policy.pap.userName=policyadmin
clamp.config.policy.pap.password=zb!XztG34
# Sdc service properties
<collectionProp name="AuthManager.auth_list">
<elementProp name="" elementType="Authorization">
<stringProp name="Authorization.url">https://${RUNTIME_HOST}:${RUNTIME_PORT}/onap/controlloop/v2</stringProp>
- <stringProp name="Authorization.username">healthcheck</stringProp>
+ <stringProp name="Authorization.username">runtimeUser</stringProp>
<stringProp name="Authorization.password">zb!XztG34</stringProp>
<stringProp name="Authorization.domain"></stringProp>
<stringProp name="Authorization.realm"></stringProp>
<collectionProp name="AuthManager.auth_list">
<elementProp name="" elementType="Authorization">
<stringProp name="Authorization.url">https://${RUNTIME_HOST}:${RUNTIME_PORT}/onap/controlloop/v2</stringProp>
- <stringProp name="Authorization.username">healthcheck</stringProp>
+ <stringProp name="Authorization.username">runtimeUser</stringProp>
<stringProp name="Authorization.password">zb!XztG34</stringProp>
<stringProp name="Authorization.domain"></stringProp>
<stringProp name="Authorization.realm"></stringProp>