diff options
Diffstat (limited to 'ms/blueprintsprocessor/functions')
31 files changed, 165 insertions, 191 deletions
diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt index 743aa714b..25bb3c938 100644 --- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt +++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt @@ -56,8 +56,9 @@ open class ComponentRemoteAnsibleExecutor(private val blueprintRestLibPropertySe private val HTTP_SUCCESS = 200..202 private val GET = HttpMethod.GET.name private val POST = HttpMethod.POST.name + private val plainTextHeaders = mapOf("Accept" to "text/plain") - var checkDelay: Long = 1_000 + var checkDelay: Long = 15_000 companion object { private val log = LoggerFactory.getLogger(ComponentRemoteAnsibleExecutor::class.java) @@ -73,6 +74,7 @@ open class ComponentRemoteAnsibleExecutor(private val blueprintRestLibPropertySe const val INPUT_SKIP_TAGS = "skip-tags" // output fields names (and values) populated by this executor; aligned with job details status field values. + const val ATTRIBUTE_EXEC_CMD_ARTIFACTS = "ansible-artifacts" const val ATTRIBUTE_EXEC_CMD_STATUS = "ansible-command-status" const val ATTRIBUTE_EXEC_CMD_LOG = "ansible-command-logs" const val ATTRIBUTE_EXEC_CMD_STATUS_ERROR = "error" @@ -161,13 +163,14 @@ open class ComponentRemoteAnsibleExecutor(private val blueprintRestLibPropertySe */ private fun runJobTemplateOnAWX(awxClient: BlueprintWebClientService, job_template_name: String?, jtId: String, workflowPrefix : String) { - setNodeOutputProperties("preparing".asJsonPrimitive(), "".asJsonPrimitive()) + setNodeOutputProperties("preparing".asJsonPrimitive(), "".asJsonPrimitive(), "".asJsonPrimitive()) // Get Job Template requirements var response = awxClient.exchangeResource(GET, "/api/v2/${workflowPrefix}job_templates/${jtId}/launch/", "") // FIXME: handle non-successful SC val jtLaunchReqs: JsonNode = mapper.readTree(response.body) - val payload = prepareLaunchPayload(awxClient, jtLaunchReqs, workflowPrefix.isBlank()) + val payload = prepareLaunchPayload(awxClient, jtLaunchReqs, workflowPrefix.isNotBlank()) + log.info("Running job with $payload, for requestId $processId.") // Launch the job for the targeted template @@ -197,10 +200,8 @@ open class ComponentRemoteAnsibleExecutor(private val blueprintRestLibPropertySe log.info("Execution of job template $job_template_name in job #$jobId finished with status ($jobStatus) for requestId $processId") - // Get workflow/job execution results - val collectedOutput = extractJobRunResponse(awxClient, jobId, workflowPrefix) + populateJobRunResponse(awxClient, jobId, workflowPrefix, jobStatus) - setNodeOutputProperties(jobStatus.asJsonPrimitive(), collectedOutput.asJsonPrimitive()) } else { // The job template requirements were not fulfilled with the values passed in. The message below will // provide more information via the response, like the ignored_fields, or variables_needed_to_start, @@ -213,33 +214,67 @@ open class ComponentRemoteAnsibleExecutor(private val blueprintRestLibPropertySe } /** - * Extracts the response from either a job stdout call OR collects the workflow run output + * Extracts the output from either a job stdout call OR collects the workflow run output, as well as the artifacts + * and populate the component corresponding output properties + */ + private fun populateJobRunResponse(awxClient: BlueprintWebClientService, jobId: String, workflowPrefix: String, + jobStatus: String) { + + val collectedResponses = StringBuilder(4096) + val artifacts: MutableMap<String, JsonNode> = mutableMapOf() + + collectJobIdsRelatedToJobRun(awxClient, jobId, workflowPrefix).forEach { aJobId -> + + // Collect the response text from the corresponding jobIds + var response = awxClient.exchangeResource(GET, "/api/v2/jobs/${aJobId}/stdout/?format=txt", "", plainTextHeaders) + if (response.status in HTTP_SUCCESS) { + val jobOutput = response.body + collectedResponses + .append("Output for Job $aJobId :" + System.lineSeparator()) + .append(jobOutput) + .append(System.lineSeparator()) + log.info("Response for job ${aJobId}: \n ${jobOutput} \n") + } else { + log.warn("Could not gather response for job ${aJobId}. Status=${response.status}") + } + + // Collect artifacts variables from each job and gather them up in one json node + response = awxClient.exchangeResource(GET, "/api/v2/jobs/${aJobId}/", "") + if (response.status in HTTP_SUCCESS) { + val jobArtifacts = mapper.readTree(response.body).at("/artifacts") + if (jobArtifacts != null) { + artifacts.putAll(jobArtifacts.rootFieldsToMap()) + } + } + } + + log.info("Artifacts for job ${jobId}: \n $artifacts \n") + + setNodeOutputProperties(jobStatus.asJsonPrimitive(), collectedResponses.toString().asJsonPrimitive(), artifacts.asJsonNode()) + } + + /** + * List all the job Ids for a give workflow, i.e. sub jobs, or the jobId if not a workflow instance */ - private fun extractJobRunResponse(awxClient: BlueprintWebClientService, jobId: String, workflowPrefix: String): String { + private fun collectJobIdsRelatedToJobRun(awxClient: BlueprintWebClientService, jobId: String, workflowPrefix: String): Array<String> { + + var jobIds: Array<String> - // First, collect all job ID from either the job template run or the workflow nodes that ran - var jobIds : Array<String> - var collectedResponses = StringBuilder() if (workflowPrefix.isNotEmpty()) { var response = awxClient.exchangeResource(GET, "/api/v2/${workflowPrefix}jobs/${jobId}/workflow_nodes/", "") val jobDetails = mapper.readTree(response.body).at("/results") + + // gather up job Id of all actual job nodes that ran during the workflow jobIds = emptyArray() for (jobDetail in jobDetails.elements()) { - jobIds = jobIds.plus( jobDetail.at("/summary_fields/job/id").asText() ) + if (jobDetail.at("/do_not_run").asText() == "false") { + jobIds = jobIds.plus(jobDetail.at("/summary_fields/job/id").asText()) + } } } else { jobIds = arrayOf(jobId) } - - // Then collect the response text from the corresponding jobIds - val plainTextHeaders = mutableMapOf<String, String>() - plainTextHeaders["Content-Type"] = "text/plain ;utf-8" - for (aJobId in jobIds) { - var response = awxClient.exchangeResource(GET, "/api/v2/jobs/${aJobId}/stdout/?format=txt", "", plainTextHeaders) - collectedResponses.append("Output for job ${aJobId}:") - collectedResponses.append(response.body) - } - return collectedResponses.toString() + return jobIds } /** @@ -282,10 +317,9 @@ open class ComponentRemoteAnsibleExecutor(private val blueprintRestLibPropertySe } payload.set(INPUT_INVENTORY, inventoryKeyId) } - val askVariablesOnLaunch = jtLaunchReqs.at("/ask_variables_on_launch").asBoolean() - if (askVariablesOnLaunch) { + payload.set("extra_vars", extraArgs) - } + return payload.asJsonString(false) } @@ -317,20 +351,23 @@ open class ComponentRemoteAnsibleExecutor(private val blueprintRestLibPropertySe /** * Utility function to set the output properties of the executor node */ - private fun setNodeOutputProperties(status: JsonNode, message: JsonNode) { + private fun setNodeOutputProperties(status: JsonNode, message: JsonNode, artifacts: JsonNode) { setAttribute(ATTRIBUTE_EXEC_CMD_STATUS, status) - log.info("Executor status: $status") + log.info("Executor status : $status") + setAttribute(ATTRIBUTE_EXEC_CMD_ARTIFACTS, artifacts) + log.info("Executor artifacts: $artifacts") setAttribute(ATTRIBUTE_EXEC_CMD_LOG, message) - log.info("Executor message: $message") + log.info("Executor message : $message") } /** * Utility function to set the output properties and errors of the executor node, in cas of errors */ - private fun setNodeOutputErrors(status: String, message: String) { + private fun setNodeOutputErrors(status: String, message: String, artifacts: JsonNode = "".asJsonPrimitive() ) { setAttribute(ATTRIBUTE_EXEC_CMD_STATUS, status.asJsonPrimitive()) setAttribute(ATTRIBUTE_EXEC_CMD_LOG, message.asJsonPrimitive()) + setAttribute(ATTRIBUTE_EXEC_CMD_ARTIFACTS, artifacts) addError(status, ATTRIBUTE_EXEC_CMD_LOG, message) } -}
\ No newline at end of file +} 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 b60290268..5e0905dec 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 @@ -86,7 +86,7 @@ class ComponentRemoteAnsibleExecutorTest { ) every { webClientService.exchangeResource("GET", "/api/v2/jobs/$jobId/stdout/?format=txt", "", - mapOf("Content-Type" to "text/plain ;utf-8")) + mapOf("Accept" to "text/plain")) } returns WebClientResponse(200, getReport()) val selector = mapper.readTree(endpointSelector) val bluePrintRestLibPropertyService = mockk<BluePrintRestLibPropertyService>() diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/logback-test.xml index 4313fa509..c2cfa9bbc 100644 --- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/logback-test.xml +++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/logback-test.xml @@ -23,7 +23,6 @@ </encoder> </appender> - <logger name="org.springframework" level="warn"/> <logger name="org.hibernate" level="info"/> <logger name="org.onap.ccsdk.cds.blueprintsprocessor" level="info"/> diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutor.kt b/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutor.kt index 180ad7b48..82eaf394d 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutor.kt +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutor.kt @@ -21,11 +21,13 @@ import com.github.fge.jsonpatch.diff.JsonDiff import org.apache.logging.log4j.util.Strings import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.ResourceConfigSnapshot -import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.ResourceConfigSnapshot.Status.RUNNING import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.ResourceConfigSnapshot.Status.CANDIDATE +import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.ResourceConfigSnapshot.Status.RUNNING import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.db.ResourceConfigSnapshotService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.* +import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive +import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType +import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing import org.slf4j.LoggerFactory import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope @@ -33,7 +35,8 @@ import org.springframework.stereotype.Component import org.w3c.dom.Node import org.xmlunit.builder.DiffBuilder import org.xmlunit.builder.Input -import org.xmlunit.diff.* +import org.xmlunit.diff.ComparisonType +import org.xmlunit.diff.Diff /** @@ -262,4 +265,4 @@ open class ComponentConfigSnapshotsExecutor(private val cfgSnapshotService: Reso return output.toString() } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshot.kt b/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshot.kt index 36a547032..ef34e6ff9 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshot.kt +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshot.kt @@ -23,14 +23,7 @@ import org.springframework.data.annotation.LastModifiedDate import org.springframework.data.jpa.domain.support.AuditingEntityListener import java.io.Serializable import java.util.* -import javax.persistence.Column -import javax.persistence.Entity -import javax.persistence.EntityListeners -import javax.persistence.Id -import javax.persistence.Lob -import javax.persistence.Table -import javax.persistence.Temporal -import javax.persistence.TemporalType +import javax.persistence.* /** * ResourceConfigSnapshot model @@ -82,4 +75,4 @@ class ResourceConfigSnapshot : Serializable { RUNNING("RUNNING"), CANDIDATE("CANDIDATE") } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotService.kt b/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotService.kt index 5fcba5b0c..73d517553 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotService.kt +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotService.kt @@ -24,7 +24,6 @@ import org.slf4j.LoggerFactory import org.springframework.dao.DataIntegrityViolationException import org.springframework.stereotype.Service import java.util.* -import kotlin.NoSuchElementException /** * ResourceConfigSnapshot managing service. @@ -75,4 +74,4 @@ class ResourceConfigSnapshotService(private val repository: ResourceConfigSnapsh } storedSnapshot } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt index c212908b9..baff96a07 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/ComponentConfigSnapshotsExecutorTest.kt @@ -27,7 +27,6 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration -import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.ComponentConfigSnapshotsExecutor import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.ComponentConfigSnapshotsExecutor.Companion.DIFF_JSON import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.ComponentConfigSnapshotsExecutor.Companion.DIFF_XML import org.onap.ccsdk.cds.blueprintsprocessor.functions.config.snapshots.ComponentConfigSnapshotsExecutor.Companion.OPERATION_DIFF diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotServiceTest.kt b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotServiceTest.kt index 3c989c154..18ee8c9dc 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotServiceTest.kt +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/config/snapshots/db/ResourceConfigSnapshotServiceTest.kt @@ -22,7 +22,6 @@ import io.mockk.verify import kotlinx.coroutines.runBlocking import org.junit.Test import kotlin.test.assertEquals -import kotlin.test.assertTrue class ResourceConfigSnapshotServiceTest { @@ -79,4 +78,4 @@ class ResourceConfigSnapshotServiceTest { assertEquals(tr, res) } } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/logback-test.xml index f33adcdb8..6598dccfa 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/logback-test.xml +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/logback-test.xml @@ -23,7 +23,6 @@ </encoder> </appender> - <logger name="org.springframework" level="warn"/> <logger name="org.hibernate" level="info"/> <logger name="org.onap.ccsdk.cds.blueprintsprocessor" level="info"/> diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/payload/requests/interface-candidate.xml b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/payload/requests/interface-candidate.xml index d0673aa4e..7914dd1b5 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/payload/requests/interface-candidate.xml +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/payload/requests/interface-candidate.xml @@ -15,20 +15,20 @@ ~ limitations under the License. --> <output xmlns="http://yang.juniper.net/junos-qfx/rpc/interfaces"> - <interface-information xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos" junos:style="normal"> - <ifd-specific-config-flags /> - <if-config-flags /> - <link-type>Full-Duplex</link-type> - <if-media-flags> - <ifmf-none /> - </if-media-flags> - <interface-flapped junos:seconds="2343">34</interface-flapped> - <traffic-statistics junos:style="brief"> - <input-packets>09098789</input-packets> - <output-packets>2828828</output-packets> - </traffic-statistics> - <physical-interface> - <interface-name>TEGig400-int01</interface-name> - </physical-interface> - </interface-information> + <interface-information xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos" junos:style="normal"> + <ifd-specific-config-flags/> + <if-config-flags/> + <link-type>Full-Duplex</link-type> + <if-media-flags> + <ifmf-none/> + </if-media-flags> + <interface-flapped junos:seconds="2343">34</interface-flapped> + <traffic-statistics junos:style="brief"> + <input-packets>09098789</input-packets> + <output-packets>2828828</output-packets> + </traffic-statistics> + <physical-interface> + <interface-name>TEGig400-int01</interface-name> + </physical-interface> + </interface-information> </output>
\ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/payload/requests/interface-running.xml b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/payload/requests/interface-running.xml index 3d875c8fb..425d70460 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/payload/requests/interface-running.xml +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/payload/requests/interface-running.xml @@ -15,18 +15,18 @@ ~ limitations under the License. --> <output xmlns="http://yang.juniper.net/junos-qfx/rpc/interfaces"> - <interface-information xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos" junos:style="normal"> - <ifd-specific-config-flags /> - <if-config-flags /> - <link-type>Full-Duplex</link-type> - <if-media-flags> - <ifmf-none /> - </if-media-flags> - <interface-flapped junos:seconds="0">Never</interface-flapped> - <traffic-statistics junos:style="brief"> - <input-packets>0</input-packets> - <output-packets>0</output-packets> - </traffic-statistics> - <physical-interface/> - </interface-information> + <interface-information xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos" junos:style="normal"> + <ifd-specific-config-flags/> + <if-config-flags/> + <link-type>Full-Duplex</link-type> + <if-media-flags> + <ifmf-none/> + </if-media-flags> + <interface-flapped junos:seconds="0">Never</interface-flapped> + <traffic-statistics junos:style="brief"> + <input-packets>0</input-packets> + <output-packets>0</output-packets> + </traffic-statistics> + <physical-interface/> + </interface-information> </output>
\ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfDeviceCommunicator.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfDeviceCommunicator.kt index aa156e2a8..bc91b7d92 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfDeviceCommunicator.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfDeviceCommunicator.kt @@ -22,15 +22,9 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.Net import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.NetconfMessageUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.RpcMessageUtils import org.slf4j.LoggerFactory -import java.io.BufferedReader -import java.io.IOException -import java.io.InputStream -import java.io.InputStreamReader -import java.io.OutputStream -import java.io.OutputStreamWriter -import java.nio.charset.StandardCharsets -import java.util.concurrent.CompletableFuture -import java.util.concurrent.TimeUnit +import java.io.* +import java.nio.charset.* +import java.util.concurrent.* class NetconfDeviceCommunicator(private var inputStream: InputStream, private var out: OutputStream, diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfRpcServiceImpl.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfRpcServiceImpl.kt index 6fa167a95..6a045e365 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfRpcServiceImpl.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfRpcServiceImpl.kt @@ -17,11 +17,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.core -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.DeviceInfo -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.DeviceResponse -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfException -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfRpcService -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfSession +import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.* import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.NetconfMessageUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.RpcStatus import org.slf4j.LoggerFactory @@ -232,4 +228,4 @@ class NetconfRpcServiceImpl(private var deviceInfo: DeviceInfo) : NetconfRpcServ response.errorMessage = null return response } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt index 4daaceeff..a0f653591 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImpl.kt @@ -22,24 +22,14 @@ import org.apache.sshd.client.SshClient import org.apache.sshd.client.channel.ClientChannel import org.apache.sshd.client.session.ClientSession import org.apache.sshd.common.FactoryManager -import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.DeviceInfo -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfException -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfReceivedEvent -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfRpcService -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfSession -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfSessionListener +import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.* import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.NetconfMessageUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.RpcMessageUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.RpcStatus import org.slf4j.LoggerFactory import java.io.IOException -import java.util.Collections -import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap -import java.util.concurrent.ExecutionException -import java.util.concurrent.TimeUnit -import java.util.concurrent.TimeoutException +import java.util.* +import java.util.concurrent.* class NetconfSessionImpl(private val deviceInfo: DeviceInfo, private val rpcService: NetconfRpcService) : NetconfSession { @@ -306,4 +296,4 @@ class NetconfSessionImpl(private val deviceInfo: DeviceInfo, private val rpcServ internal fun setClient(client: SshClient) { this.client = client } internal fun setSession(session: ClientSession) { this.session = session } internal fun setChannel(channel: ClientChannel) { this.channel = channel } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/NetconfMessageUtils.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/NetconfMessageUtils.kt index 37ff67433..4d65d36bb 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/NetconfMessageUtils.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/NetconfMessageUtils.kt @@ -54,7 +54,7 @@ class NetconfMessageUtils { request.append(filterContent).append(NEW_LINE) request.append(RpcMessageUtils.SUBTREE_FILTER_CLOSE).append(NEW_LINE) } - request.append("</get>").append(NEW_LINE) + request.append("</get>") return doWrappedRpc(messageId, request.toString()) } @@ -73,7 +73,7 @@ class NetconfMessageUtils { request.append(filterContent).append(NEW_LINE) request.append(RpcMessageUtils.SUBTREE_FILTER_CLOSE).append(NEW_LINE) } - request.append("</get-config>").append(NEW_LINE) + request.append("</get-config>") return doWrappedRpc(messageId, request.toString()) } @@ -84,8 +84,7 @@ class NetconfMessageUtils { rpc.append(RpcMessageUtils.MESSAGE_ID_STRING).append(RpcMessageUtils.EQUAL) rpc.append(RpcMessageUtils.QUOTE).append(messageId).append(RpcMessageUtils.QUOTE_SPACE) rpc.append(RpcMessageUtils.NETCONF_BASE_NAMESPACE).append(RpcMessageUtils.CLOSE) - .append(NEW_LINE) - rpc.append(request) + rpc.append(NEW_LINE).append(request).append(NEW_LINE) rpc.append(RpcMessageUtils.RPC_CLOSE) // rpc.append(NEW_LINE).append(END_PATTERN); @@ -94,9 +93,7 @@ class NetconfMessageUtils { fun editConfig(messageId: String, configType: String, defaultOperation: String?, newConfiguration: String): String { - val request = StringBuilder() - request.append("<edit-config>").append(NEW_LINE) request.append(RpcMessageUtils.TARGET_OPEN).append(NEW_LINE) request.append(RpcMessageUtils.OPEN).append(configType).append(RpcMessageUtils.TAG_CLOSE) @@ -112,7 +109,7 @@ class NetconfMessageUtils { request.append(RpcMessageUtils.CONFIG_OPEN).append(NEW_LINE) request.append(newConfiguration.trim { it <= ' ' }).append(NEW_LINE) request.append(RpcMessageUtils.CONFIG_CLOSE).append(NEW_LINE) - request.append("</edit-config>").append(NEW_LINE) + request.append("</edit-config>") return doWrappedRpc(messageId, request.toString()) } @@ -125,7 +122,7 @@ class NetconfMessageUtils { request.append(RpcMessageUtils.OPEN).append(configType).append(RpcMessageUtils.TAG_CLOSE) .append(NEW_LINE) request.append(RpcMessageUtils.SOURCE_CLOSE).append(NEW_LINE) - request.append("</validate>").append(NEW_LINE) + request.append("</validate>") return doWrappedRpc(messageId, request.toString()) } @@ -145,16 +142,16 @@ class NetconfMessageUtils { val request = StringBuilder() request.append("<commit>").append(NEW_LINE) if (confirmed) { - request.append("<confirmed/>") - request.append("<confirm-timeout>$confirmTimeout</confirm-timeout>") + request.append("<confirmed/>").append(NEW_LINE) + request.append("<confirm-timeout>$confirmTimeout</confirm-timeout>").append(NEW_LINE) if (!persist.isEmpty()) { - request.append("<persist>$persist</persist>") + request.append("<persist>$persist</persist>").append(NEW_LINE) } } if (!persistId.isEmpty()) { - request.append("<persist-id>$persistId</persist-id>") + request.append("<persist-id>$persistId</persist-id>").append(NEW_LINE) } - request.append("</commit>").append(NEW_LINE) + request.append("</commit>") return doWrappedRpc(messageId, request.toString()) } @@ -163,9 +160,9 @@ class NetconfMessageUtils { val request = StringBuilder() request.append("<cancel-commit>").append(NEW_LINE) if (!persistId.isEmpty()) { - request.append("<persist-id>$persistId</persist-id>") + request.append("<persist-id>$persistId</persist-id>").append(NEW_LINE) } - request.append("</cancel-commit>").append(NEW_LINE) + request.append("</cancel-commit>") return doWrappedRpc(messageId, request.toString()) } @@ -178,7 +175,7 @@ class NetconfMessageUtils { request.append(RpcMessageUtils.OPEN).append(configType).append(RpcMessageUtils.TAG_CLOSE) .append(NEW_LINE) request.append(RpcMessageUtils.TARGET_CLOSE).append(NEW_LINE) - request.append("</unlock>").append(NEW_LINE) + request.append("</unlock>") return doWrappedRpc(messageId, request.toString()) } @@ -198,14 +195,14 @@ class NetconfMessageUtils { .append(RpcMessageUtils.TAG_CLOSE) .append(NEW_LINE) request.append(RpcMessageUtils.TARGET_CLOSE).append(NEW_LINE) - request.append("</delete-config>").append(NEW_LINE) + request.append("</delete-config>") return doWrappedRpc(messageId, request.toString()) } fun discardChanges(messageId: String): String { val request = StringBuilder() - request.append("<discard-changes/>").append(NEW_LINE) + request.append("<discard-changes/>") return doWrappedRpc(messageId, request.toString()) } @@ -217,7 +214,7 @@ class NetconfMessageUtils { request.append(RpcMessageUtils.OPEN).append(configType).append(RpcMessageUtils.TAG_CLOSE) .append(NEW_LINE) request.append(RpcMessageUtils.TARGET_CLOSE).append(NEW_LINE) - request.append("</lock>").append(NEW_LINE) + request.append("</lock>") return doWrappedRpc(messageId, request.toString()) } @@ -226,9 +223,9 @@ class NetconfMessageUtils { val request = StringBuilder() if (force) { - request.append("<kill-session/>").append(NEW_LINE) + request.append("<kill-session/>") } else { - request.append("<close-session/>").append(NEW_LINE) + request.append("<close-session/>") } return doWrappedRpc(messageId, request.toString()) diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/api/DeviceInfoTest.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/api/DeviceInfoTest.kt index d46ee78dd..4e1ff655d 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/api/DeviceInfoTest.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/api/DeviceInfoTest.kt @@ -17,7 +17,6 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.DeviceInfo import org.junit.Test import kotlin.test.assertEquals diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfDeviceCommunicatorTest.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfDeviceCommunicatorTest.kt index 47c729187..2240f48c2 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfDeviceCommunicatorTest.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfDeviceCommunicatorTest.kt @@ -16,13 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.core -import io.mockk.CapturingSlot -import io.mockk.Runs -import io.mockk.every -import io.mockk.just -import io.mockk.mockk -import io.mockk.spyk -import io.mockk.verify +import io.mockk.* import org.junit.Before import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.DeviceInfo @@ -33,10 +27,9 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils.R import java.io.IOException import java.io.InputStream import java.io.OutputStream -import java.nio.charset.StandardCharsets -import java.util.concurrent.CompletableFuture -import java.util.concurrent.ConcurrentHashMap -import java.util.regex.Pattern +import java.nio.charset.* +import java.util.concurrent.* +import java.util.regex.* import kotlin.test.assertEquals import kotlin.test.assertFalse import kotlin.test.assertTrue @@ -185,10 +178,10 @@ class NetconfDeviceCommunicatorTest { //eventually, sessionListener is called with message type DEVICE_REPLY assertEquals(NetconfReceivedEvent.Type.DEVICE_REPLY, eventSlot.captured.type) assertEquals(""" -<rpc message-id="102" - xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> - <close-session/> -</rpc> + <rpc message-id="102" + xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> + <close-session/> + </rpc> """.trimIndent(), eventSlot.captured.messagePayload) } @@ -256,4 +249,4 @@ class NetconfDeviceCommunicatorTest { } } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfMessageStateTest.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfMessageStateTest.kt index 95148dd11..ce7594c4a 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfMessageStateTest.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfMessageStateTest.kt @@ -17,8 +17,9 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.core import org.junit.Test -import kotlin.test.assertEquals import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.core.NetconfDeviceCommunicator.NetconfMessageState +import kotlin.test.assertEquals + class NetconfMessageStateTest { private val charList: List<Char> = Char.MIN_VALUE.toInt().rangeTo(Char.MAX_VALUE.toInt()) @@ -143,4 +144,4 @@ class NetconfMessageStateTest { } } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt index 7f6c8d390..e3cda5a49 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/core/NetconfSessionImplTest.kt @@ -16,13 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.core -import io.mockk.CapturingSlot -import io.mockk.Runs -import io.mockk.every -import io.mockk.just -import io.mockk.mockk -import io.mockk.spyk -import io.mockk.verify +import io.mockk.* import org.apache.sshd.client.SshClient import org.apache.sshd.client.channel.ChannelSubsystem import org.apache.sshd.client.channel.ClientChannel @@ -43,10 +37,8 @@ import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream import java.io.IOException import java.io.InputStream -import java.nio.charset.StandardCharsets -import java.util.concurrent.CompletableFuture -import java.util.concurrent.ExecutionException -import java.util.concurrent.TimeoutException +import java.nio.charset.* +import java.util.concurrent.* import kotlin.test.assertEquals import kotlin.test.assertFailsWith import kotlin.test.assertTrue diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/NetconfMessageUtilsTest.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/NetconfMessageUtilsTest.kt index 33135e30f..fcfa12570 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/NetconfMessageUtilsTest.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/NetconfMessageUtilsTest.kt @@ -16,7 +16,7 @@ */ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils -import org.junit.Assert.* +import org.junit.Assert.assertEquals import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfException import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import kotlin.test.Test diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/RpcMessageUtilsTest.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/RpcMessageUtilsTest.kt index ffbf7306c..b80dc2d88 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/RpcMessageUtilsTest.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/utils/RpcMessageUtilsTest.kt @@ -17,7 +17,6 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.utils import org.junit.Assert import org.junit.Assert.assertTrue -import org.junit.Ignore import org.junit.Test import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.NetconfException import kotlin.test.assertFailsWith @@ -331,4 +330,4 @@ class RpcMessageUtilsTest { assertFalse { NetconfMessageUtils.validateRPCXML("really bad XML ~~~input") } } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/cancelCommit-response-all-parameters-not-empty.xml b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/cancelCommit-response-all-parameters-not-empty.xml index 7f5a44cc5..177a97a92 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/cancelCommit-response-all-parameters-not-empty.xml +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/cancelCommit-response-all-parameters-not-empty.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <rpc message-id="customMessageId" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <cancel-commit> -<persist-id>customPersistId</persist-id></cancel-commit> +<persist-id>customPersistId</persist-id> +</cancel-commit> </rpc>
\ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/commit-response-confirmed-false-and-persistId-empty-and-persist-not-empty.xml b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/commit-response-confirmed-false-and-persistId-empty-and-persist-not-empty.xml index d19e5b41e..26a122815 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/commit-response-confirmed-false-and-persistId-empty-and-persist-not-empty.xml +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/commit-response-confirmed-false-and-persistId-empty-and-persist-not-empty.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <rpc message-id="customMessageId" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <commit> -<persist-id>customPersistId</persist-id></commit> +<persist-id>customPersistId</persist-id> +</commit> </rpc>
\ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/commit-response-confirmed-true-and-persistId-empty-and-persist-empty.xml b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/commit-response-confirmed-true-and-persistId-empty-and-persist-empty.xml index ad0fef80f..9cb86d51c 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/commit-response-confirmed-true-and-persistId-empty-and-persist-empty.xml +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/commit-response-confirmed-true-and-persistId-empty-and-persist-empty.xml @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <rpc message-id="customMessageId" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <commit> -<confirmed/><confirm-timeout>1</confirm-timeout></commit> +<confirmed/> +<confirm-timeout>1</confirm-timeout> +</commit> </rpc>
\ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/doWrappedRpc-response.xml b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/doWrappedRpc-response.xml index 0f6c3e76b..c689fbaf6 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/doWrappedRpc-response.xml +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/netconf-messages/doWrappedRpc-response.xml @@ -1,3 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <rpc message-id="customMessageId" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> -customRequest</rpc>
\ No newline at end of file +customRequest +</rpc>
\ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/functions/python-executor/src/test/resources/logback-test.xml index e04e741c9..f06ea1431 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/test/resources/logback-test.xml +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/resources/logback-test.xml @@ -23,7 +23,6 @@ </encoder> </appender> - <logger name="org.springframework" level="warn"/> <logger name="org.hibernate" level="info"/> <logger name="org.onap.ccsdk.cds.blueprintsprocessor" level="info"/> diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt index 51170a9b2..a23036aaf 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt @@ -28,7 +28,6 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.proc import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceDefinitionUtils.createResourceAssignments import org.onap.ccsdk.cds.controllerblueprints.core.* -import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintTemplateService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolution.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolution.kt index baabfd913..781cafd97 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolution.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/ResourceResolution.kt @@ -23,15 +23,7 @@ import org.springframework.data.annotation.LastModifiedDate import org.springframework.data.jpa.domain.support.AuditingEntityListener import java.io.Serializable import java.util.* -import javax.persistence.Column -import javax.persistence.ElementCollection -import javax.persistence.Entity -import javax.persistence.EntityListeners -import javax.persistence.Id -import javax.persistence.Lob -import javax.persistence.Table -import javax.persistence.Temporal -import javax.persistence.TemporalType +import javax.persistence.* @EntityListeners(AuditingEntityListener::class) @Entity @@ -109,4 +101,4 @@ class ResourceResolution : Serializable { companion object { private const val serialVersionUID = 1L } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolution.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolution.kt index e3f876365..9d5a3f5d5 100755 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolution.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/db/TemplateResolution.kt @@ -23,14 +23,7 @@ import org.springframework.data.annotation.LastModifiedDate import org.springframework.data.jpa.domain.support.AuditingEntityListener import java.io.Serializable import java.util.* -import javax.persistence.Column -import javax.persistence.Entity -import javax.persistence.EntityListeners -import javax.persistence.Id -import javax.persistence.Lob -import javax.persistence.Table -import javax.persistence.Temporal -import javax.persistence.TemporalType +import javax.persistence.* @EntityListeners(AuditingEntityListener::class) @Entity diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt index 6a37f5914..2879342f6 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessorTest.kt @@ -25,7 +25,6 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.mock.MockRestResourceResolutionProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -33,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner -import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.assertNotNull diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/logback-test.xml index f379f37ed..f915b1ae3 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/logback-test.xml +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/resources/logback-test.xml @@ -23,7 +23,6 @@ </encoder> </appender> - <logger name="org.springframework" level="warn"/> <logger name="org.hibernate" level="info"/> <logger name="org.mockserver.mock" level="warn"/> |