summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2019-11-22 18:06:08 -0500
committerKAPIL SINGAL <ks220y@att.com>2019-11-26 21:32:38 +0000
commit341db21b2ac0a14a1ed2b8bf7930914dda054bfe (patch)
tree113bba965b06cfe3a8af3a0a527d1a41c9faf0f9 /ms/blueprintsprocessor/functions/ansible-awx-executor/src/test
parentd274e5fc552cf9ae25500f504f0434981cf3accf (diff)
Formatting Code base with ktlint
No Business logic change, just the code format. Competible with IntelliJ: https://github.com/pinterest/ktlint#option-3 To format run: mvn process-sources -P format Issue-ID: CCSDK-1947 Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com> Change-Id: Ic9e9209fb7023d77f434693ad5a01229f8d09331
Diffstat (limited to 'ms/blueprintsprocessor/functions/ansible-awx-executor/src/test')
-rw-r--r--ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt52
1 files changed, 33 insertions, 19 deletions
diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt
index 5e0905dec..262563d1f 100644
--- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt
+++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutorTest.kt
@@ -73,20 +73,24 @@ class ComponentRemoteAnsibleExecutorTest {
webClientService.exchangeResource("GET", "/api/v2/inventories/?name=Demo+Inventory", "")
} returns WebClientResponse(200, getInventory())
every {
- webClientService.exchangeResource("POST", "/api/v2/job_templates/$jtId/launch/",
- """{"inventory":1,"extra_vars":{"site_id":"3 - Belmont","tor_group":"vEPC"}}""")
+ webClientService.exchangeResource(
+ "POST", "/api/v2/job_templates/$jtId/launch/",
+ """{"inventory":1,"extra_vars":{"site_id":"3 - Belmont","tor_group":"vEPC"}}"""
+ )
} returns WebClientResponse(201, newJobTemplateLaunch(jtId, jobId))
every {
webClientService.exchangeResource("GET", "/api/v2/jobs/$jobId/", "")
} returnsMany listOf(
- WebClientResponse(200, getJobStatus1(jtId, jobId)),
- WebClientResponse(200, getJobStatus2(jtId, jobId)),
- WebClientResponse(200, getJobStatus3(jtId, jobId)),
- WebClientResponse(200, getJobStatus4(jtId, jobId))
+ WebClientResponse(200, getJobStatus1(jtId, jobId)),
+ WebClientResponse(200, getJobStatus2(jtId, jobId)),
+ WebClientResponse(200, getJobStatus3(jtId, jobId)),
+ WebClientResponse(200, getJobStatus4(jtId, jobId))
)
every {
- webClientService.exchangeResource("GET", "/api/v2/jobs/$jobId/stdout/?format=txt", "",
- mapOf("Accept" to "text/plain"))
+ webClientService.exchangeResource(
+ "GET", "/api/v2/jobs/$jobId/stdout/?format=txt", "",
+ mapOf("Accept" to "text/plain")
+ )
} returns WebClientResponse(200, getReport())
val selector = mapper.readTree(endpointSelector)
val bluePrintRestLibPropertyService = mockk<BluePrintRestLibPropertyService>()
@@ -95,8 +99,9 @@ class ComponentRemoteAnsibleExecutorTest {
awxRemoteExecutor.checkDelay = 1
val executionServiceInput = JacksonUtils.readValueFromClassPathFile(
- "payload/requests/sample-remote-ansible-request.json",
- ExecutionServiceInput::class.java)!!
+ "payload/requests/sample-remote-ansible-request.json",
+ ExecutionServiceInput::class.java
+ )!!
val bluePrintRuntimeService = createBlueprintRuntimeService(awxRemoteExecutor, executionServiceInput)
@@ -128,8 +133,9 @@ class ComponentRemoteAnsibleExecutorTest {
awxRemoteExecutor.checkDelay = 1
val executionServiceInput = JacksonUtils.readValueFromClassPathFile(
- "payload/requests/remote-ansible-request-full.json",
- ExecutionServiceInput::class.java)!!
+ "payload/requests/remote-ansible-request-full.json",
+ ExecutionServiceInput::class.java
+ )!!
val bluePrintRuntimeService = createBlueprintRuntimeService(awxRemoteExecutor, executionServiceInput)
@@ -156,8 +162,10 @@ class ComponentRemoteAnsibleExecutorTest {
webClientService.exchangeResource("GET", "/api/v2/inventories/?name=Demo+Inventory", "")
} returns WebClientResponse(200, getInventory())
every {
- webClientService.exchangeResource("POST", "/api/v2/job_templates/$jtId/launch/",
- """{"limit":"123","tags":"some-tag","skip_tags":"some-skip-tag","inventory":1,"extra_vars":{"site_id":"3 - Belmont","tor_group":"vEPC"}}""")
+ webClientService.exchangeResource(
+ "POST", "/api/v2/job_templates/$jtId/launch/",
+ """{"limit":"123","tags":"some-tag","skip_tags":"some-skip-tag","inventory":1,"extra_vars":{"site_id":"3 - Belmont","tor_group":"vEPC"}}"""
+ )
} returns WebClientResponse(500, "")
val selector = mapper.readTree(endpointSelector)
val bluePrintRestLibPropertyService = mockk<BluePrintRestLibPropertyService>()
@@ -166,8 +174,9 @@ class ComponentRemoteAnsibleExecutorTest {
awxRemoteExecutor.checkDelay = 1
val executionServiceInput = JacksonUtils.readValueFromClassPathFile(
- "payload/requests/remote-ansible-request-full.json",
- ExecutionServiceInput::class.java)!!
+ "payload/requests/remote-ansible-request-full.json",
+ ExecutionServiceInput::class.java
+ )!!
val bluePrintRuntimeService = createBlueprintRuntimeService(awxRemoteExecutor, executionServiceInput)
@@ -181,9 +190,14 @@ class ComponentRemoteAnsibleExecutorTest {
assertEquals(1, errors.size)
}
- private fun createBlueprintRuntimeService(awxRemoteExecutor: ComponentRemoteAnsibleExecutor, executionServiceInput: ExecutionServiceInput): BluePrintRuntimeService<MutableMap<String, JsonNode>> {
- val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime("123456-1000",
- "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_ansible")
+ private fun createBlueprintRuntimeService(
+ awxRemoteExecutor: ComponentRemoteAnsibleExecutor,
+ executionServiceInput: ExecutionServiceInput
+ ): BluePrintRuntimeService<MutableMap<String, JsonNode>> {
+ val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
+ "123456-1000",
+ "./../../../../components/model-catalog/blueprint-model/test-blueprint/remote_ansible"
+ )
awxRemoteExecutor.bluePrintRuntimeService = bluePrintRuntimeService
val workflowName = executionServiceInput.actionIdentifiers.actionName