diff options
Diffstat (limited to 'ms/blueprintsprocessor')
58 files changed, 262 insertions, 309 deletions
diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index 90e9f501b..1c12469f4 100755 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -78,7 +78,6 @@ <artifactId>health-api</artifactId> </dependency> - <!-- Functions --> <dependency> <groupId>org.onap.ccsdk.cds.blueprintsprocessor.functions</groupId> diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/security/BasicAuthServerInterceptor.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/security/BasicAuthServerInterceptor.java index 380ed3618..d0bf9e87f 100644 --- a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/security/BasicAuthServerInterceptor.java +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/security/BasicAuthServerInterceptor.java @@ -16,13 +16,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.security; import com.google.common.base.Strings; -import io.grpc.Metadata; -import io.grpc.ServerCall; -import io.grpc.ServerCallHandler; -import io.grpc.ServerInterceptor; -import io.grpc.Status; -import java.nio.charset.StandardCharsets; -import java.util.Base64; +import io.grpc.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -33,6 +27,9 @@ import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Component; +import java.nio.charset.StandardCharsets; +import java.util.Base64; + @Component public class BasicAuthServerInterceptor implements ServerInterceptor { diff --git a/ms/blueprintsprocessor/application/src/main/resources/logback.xml b/ms/blueprintsprocessor/application/src/main/resources/logback.xml index 872ee4f15..6f917096d 100644 --- a/ms/blueprintsprocessor/application/src/main/resources/logback.xml +++ b/ms/blueprintsprocessor/application/src/main/resources/logback.xml @@ -23,7 +23,6 @@ </encoder> </appender> - <logger name="org.springframework" level="info"/> <logger name="org.springframework.web" level="info"/> <logger name="org.hibernate" level="error"/> diff --git a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ExtendedTemporaryFolder.kt b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ExtendedTemporaryFolder.kt index 3c517e6ac..57b4573ef 100644 --- a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ExtendedTemporaryFolder.kt +++ b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ExtendedTemporaryFolder.kt @@ -22,11 +22,8 @@ package org.onap.ccsdk.cds.blueprintsprocessor import org.junit.rules.TemporaryFolder import java.io.File import java.io.IOException -import java.nio.file.FileVisitResult -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.SimpleFileVisitor -import java.nio.file.attribute.BasicFileAttributes +import java.nio.file.* +import java.nio.file.attribute.* import javax.annotation.PreDestroy class ExtendedTemporaryFolder { 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"/> diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MariaDatabaseConfiguration.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MariaDatabaseConfiguration.kt index 5015388b9..6a0d4a0c5 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MariaDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/MariaDatabaseConfiguration.kt @@ -21,11 +21,6 @@ import org.onap.ccsdk.cds.blueprintsprocessor.db.MariaDataSourceProperties import org.slf4j.LoggerFactory import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate import org.springframework.jdbc.datasource.DriverManagerDataSource -import org.springframework.orm.jpa.JpaTransactionManager -import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean -import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter -import org.springframework.transaction.PlatformTransactionManager -import java.util.* import javax.sql.DataSource class MariaDatabaseConfiguration(private val mariaDataSourceProperties: MariaDataSourceProperties) : BluePrintDBLibGenericService { diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/service/BlueprintProcessorCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/service/BlueprintProcessorCatalogServiceImpl.kt index 3e0f3516f..5d04ddfdf 100755 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/service/BlueprintProcessorCatalogServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/service/BlueprintProcessorCatalogServiceImpl.kt @@ -34,6 +34,7 @@ import org.springframework.stereotype.Service import java.io.File import java.nio.file.Path import java.util.* + // TODO("Duplicate : Merge BlueprintProcessorCatalogServiceImpl and ControllerBlueprintCatalogServiceImpl") /** * Similar/Duplicate implementation in [org.onap.ccsdk.cds.controllerblueprints.service.load.ControllerBlueprintCatalogServiceImpl] diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/service/ControllerBlueprintCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/service/ControllerBlueprintCatalogServiceImpl.kt index 4c02fda12..e7a8e31a7 100755 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/service/ControllerBlueprintCatalogServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/service/ControllerBlueprintCatalogServiceImpl.kt @@ -35,6 +35,7 @@ import java.io.File import java.nio.file.Files import java.nio.file.Path import java.util.* + //TODO("Duplicate : Merge BlueprintProcessorCatalogServiceImpl and ControllerBlueprintCatalogServiceImpl") /** * Similar implementation in [org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintProcessorCatalogServiceImpl] diff --git a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/resources/logback-test.xml index cff57423d..dad15aa4a 100644 --- a/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/resources/logback-test.xml +++ b/ms/blueprintsprocessor/modules/commons/dmaap-lib/src/test/resources/logback-test.xml @@ -18,7 +18,6 @@ ~ ============LICENSE_END========================================================= --> - <configuration> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <!-- encoders are assigned the type diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibData.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibData.kt index 68672f227..1e6e23b86 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibData.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/BluePrintRestLibData.kt @@ -28,6 +28,7 @@ open class SSLRestClientProperties : RestClientProperties() { lateinit var keyStoreInstance: String // JKS, PKCS12 lateinit var sslTrust: String lateinit var sslTrustPassword: String + var sslTrustIgnoreHostname: Boolean = false var sslKey: String? = null var sslKeyPassword: String? = null } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BasicAuthRestClientService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BasicAuthRestClientService.kt index bb6937d7c..9ce3beab6 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BasicAuthRestClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BasicAuthRestClientService.kt @@ -18,10 +18,6 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest.service import org.apache.http.message.BasicHeader import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestLibConstants -import org.onap.ccsdk.cds.blueprintsprocessor.rest.utils.WebClientUtils -import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.springframework.http.HttpHeaders import org.springframework.http.MediaType import java.nio.charset.Charset diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt index 8d4f0ca63..9fa13bdaf 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt @@ -20,15 +20,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest.service import com.fasterxml.jackson.databind.JsonNode import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.DME2RestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.PolicyManagerRestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestLibConstants -import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLBasicAuthRestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLRestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.SSLTokenAuthRestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.TokenAuthRestClientProperties +import org.onap.ccsdk.cds.blueprintsprocessor.rest.* import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.stereotype.Service diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/SSLRestClientService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/SSLRestClientService.kt index 2acf776ca..0ef1757e2 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/SSLRestClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/SSLRestClientService.kt @@ -32,6 +32,7 @@ import java.io.File import java.io.FileInputStream import java.security.KeyStore import java.security.cert.X509Certificate +import org.apache.http.conn.ssl.NoopHostnameVerifier class SSLRestClientService(private val restClientProperties: SSLRestClientProperties) : BlueprintWebClientService { @@ -87,6 +88,7 @@ class SSLRestClientService(private val restClientProperties: SSLRestClientProper val sslKeyPwd = restClientProperties.sslKeyPassword val sslTrust = restClientProperties.sslTrust val sslTrustPwd = restClientProperties.sslTrustPassword + val sslTrustIgnoreHostname = restClientProperties.sslTrustIgnoreHostname val acceptingTrustStrategy = { _: Array<X509Certificate>, _: String -> true @@ -101,9 +103,13 @@ class SSLRestClientService(private val restClientProperties: SSLRestClientProper } } - sslContext.loadTrustMaterial(File(sslTrust), sslTrustPwd.toCharArray(), - acceptingTrustStrategy) - val csf = SSLConnectionSocketFactory(sslContext.build()) + sslContext.loadTrustMaterial(File(sslTrust), sslTrustPwd.toCharArray(), acceptingTrustStrategy) + var csf : SSLConnectionSocketFactory + if (sslTrustIgnoreHostname) { + csf = SSLConnectionSocketFactory(sslContext.build(), NoopHostnameVerifier()) + } else { + csf = SSLConnectionSocketFactory(sslContext.build()) + } return HttpClients.custom() .addInterceptorFirst(WebClientUtils.logRequest()) .addInterceptorLast(WebClientUtils.logResponse()) diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt index e6a66800b..46d171b5d 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt @@ -48,14 +48,7 @@ import org.springframework.security.web.server.SecurityWebFilterChain import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner -import org.springframework.web.bind.annotation.DeleteMapping -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.PatchMapping -import org.springframework.web.bind.annotation.PostMapping -import org.springframework.web.bind.annotation.PutMapping -import org.springframework.web.bind.annotation.RequestHeader -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import kotlin.test.assertEquals import kotlin.test.assertNotNull diff --git a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt index b4c1ad0e0..89f62812e 100644 --- a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/configs/api/ResourceConfigSnapshotControllerTest.kt @@ -32,7 +32,6 @@ import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner import org.springframework.test.web.reactive.server.WebTestClient import org.springframework.web.reactive.function.BodyInserters -import java.util.* @RunWith(SpringRunner::class) @WebFluxTest @@ -173,4 +172,4 @@ class ResourceConfigSnapshotControllerTest { .expectBody().equals(snapshotData) } } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/resources/logback.xml b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/resources/logback.xml index ed92b8963..c97e1cd29 100644 --- a/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/resources/logback.xml +++ b/ms/blueprintsprocessor/modules/inbounds/configs-api/src/test/resources/logback.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/modules/inbounds/designer-api/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/logback-test.xml index feb4514d6..1b1c54cc3 100644 --- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/logback-test.xml +++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ <configuration> - <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> <encoder> @@ -25,7 +25,6 @@ </encoder> </appender> - <logger name="org.springframework" level="warn"/> <logger name="org.springframework.web" level="warn"/> <logger name="org.hibernate" level="error"/> diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/health-api/pom.xml index 9d50e13d4..01903a4c6 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/health-api/pom.xml @@ -16,24 +16,24 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId> - <artifactId>inbounds</artifactId> - <version>0.7.0-SNAPSHOT</version> - </parent> + <parent> + <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId> + <artifactId>inbounds</artifactId> + <version>0.7.0-SNAPSHOT</version> + </parent> - <artifactId>health-api</artifactId> - <packaging>jar</packaging> + <artifactId>health-api</artifactId> + <packaging>jar</packaging> - <name>Blueprints Processor Health API</name> - <description>checking system check health endpoints</description> + <name>Blueprints Processor Health API</name> + <description>checking system check health endpoints</description> - <dependencies> - <dependency> - <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId> - <artifactId>rest-lib</artifactId> - </dependency> - </dependencies> + <dependencies> + <dependency> + <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId> + <artifactId>rest-lib</artifactId> + </dependency> + </dependencies> </project> diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckServiceTest.java b/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckServiceTest.java index 8fb5e58fc..128c80adf 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckServiceTest.java +++ b/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/HealthCheckServiceTest.java @@ -16,13 +16,6 @@ package org.onap.ccsdk.cds.blueprintsprocessor.healthapi; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.anyString; - import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -39,6 +32,12 @@ import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BasicAuthRestClientSe import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService.WebClientResponse; import org.springframework.http.HttpMethod; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.anyString; + @RunWith(MockitoJUnitRunner.class) public class HealthCheckServiceTest { diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/resources/logback.xml b/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/resources/logback.xml index ed92b8963..c97e1cd29 100644 --- a/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/resources/logback.xml +++ b/ms/blueprintsprocessor/modules/inbounds/health-api/src/test/resources/logback.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/modules/inbounds/resource-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TemplateController.kt b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TemplateController.kt index de5843a66..93253a554 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TemplateController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/resource/api/TemplateController.kt @@ -24,7 +24,6 @@ import kotlinx.coroutines.runBlocking import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.TemplateResolution import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.db.TemplateResolutionService import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils -import org.springframework.dao.EmptyResultDataAccessException import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.security.access.prepost.PreAuthorize diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/resources/logback.xml b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/resources/logback.xml index c546502cf..9c690fcc9 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/resources/logback.xml +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/src/test/resources/logback.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/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BluePrintMappings.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BluePrintMappings.kt index b5984d738..46633aa60 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BluePrintMappings.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/BluePrintMappings.kt @@ -19,11 +19,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode import com.google.common.base.Strings import com.google.protobuf.Struct import com.google.protobuf.util.JsonFormat -import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers -import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader -import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType -import org.onap.ccsdk.cds.controllerblueprints.common.api.Flag -import org.onap.ccsdk.cds.controllerblueprints.common.api.Status +import org.onap.ccsdk.cds.controllerblueprints.common.api.* import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/logback-test.xml index dd81657a4..117746fa2 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/logback-test.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/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/modules/services/execution-service/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/modules/services/execution-service/src/test/resources/logback-test.xml index da1553d2c..703a52642 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/resources/logback-test.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/resources/logback-test.xml @@ -23,7 +23,6 @@ </encoder> </appender> - <logger name="org.springframework" level="warn"/> <logger name="org.hibernate" level="warn"/> <logger name="org.onap.ccsdk.cds.blueprintsprocessor" level="info"/> diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt index 6e7e3cb8d..3ac5cd864 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt @@ -29,7 +29,6 @@ import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonReactorUtils import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.ApplicationContext -import org.springframework.test.annotation.DirtiesContext import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.junit4.SpringRunner import kotlin.test.assertEquals @@ -76,4 +75,4 @@ class DGWorkflowExecutionServiceTest { } -}
\ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/resources/logback.xml b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/resources/logback.xml index 32459375e..1a6114bb8 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/resources/logback.xml +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/resources/logback.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/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index 726ba55c5..ac123cbfd 100755 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -31,28 +31,36 @@ <description>Blueprints Processor Parent</description> <properties> - <sshd.version>2.2.0</sshd.version> - <jsch.version>0.1.55</jsch.version> + <sli.version>${ccsdk.sli.core.version}</sli.version> + <dmaap.client.version>1.1.5</dmaap.client.version> + + <!-- Should be using released artifact as soon as available: --> + <!-- https://github.com/springfox/springfox/milestone/44 --> + <springfox.swagger2.version>2.9.2</springfox.swagger2.version> <spring.kafka.version>2.2.6.RELEASE</spring.kafka.version> <kafka.version>2.2.0</kafka.version> <eelf.version>1.0.0</eelf.version> - <sli.version>${ccsdk.sli.core.version}</sli.version> - <guava.version>27.0.1-jre</guava.version> - <jython.version>2.7.1</jython.version> - <!-- Should be using released artifact as soon as available:--> - <!-- https://github.com/springfox/springfox/milestone/44--> - <springfox.swagger2.version>2.9.2</springfox.swagger2.version> - <h2database.version>1.4.197</h2database.version> <onap.logger.slf4j>1.2.2</onap.logger.slf4j> + + <h2database.version>1.4.197</h2database.version> <powermock.version>1.7.4</powermock.version> - <dmaap.client.version>1.1.5</dmaap.client.version> + <mockkserver.version>5.5.1</mockkserver.version> + <json.unit.version>2.8.0</json.unit.version> + <xmlunit.version>2.6.3</xmlunit.version> + + <sshd.version>2.2.0</sshd.version> + <jsch.version>0.1.55</jsch.version> + <jython.version>2.7.1</jython.version> <jinja.version>2.5.1</jinja.version> <velocity.version>1.7</velocity.version> - <json.unit.version>2.8.0</json.unit.version> - <mockkserver.version>5.5.1</mockkserver.version> + <guava.version>27.0.1-jre</guava.version> <jsoup.version>1.10.3</jsoup.version> - <xmlunit.version>2.6.3</xmlunit.version> <json-patch.version>1.9</json-patch.version> + <json-smart.version>2.3</json-smart.version> + + <commons-io-version>2.6</commons-io-version> + <commons-lang3-version>3.2.1</commons-lang3-version> + <commons-collections-version>3.2.2</commons-collections-version> </properties> <dependencyManagement> @@ -101,33 +109,36 @@ </exclusion> </exclusions> </dependency> -<!-- <dependency>--> -<!-- <groupId>io.springfox</groupId>--> -<!-- <artifactId>springfox-spring-webflux</artifactId>--> -<!-- <version>${springfox.swagger2.version}</version>--> -<!-- <exclusions>--> -<!-- <exclusion>--> -<!-- <groupId>org.slf4j</groupId>--> -<!-- <artifactId>slf4j-api</artifactId>--> -<!-- </exclusion>--> -<!-- </exclusions>--> -<!-- </dependency>--> + + <!-- + <dependency> + <groupId>io.springfox</groupId> + <artifactId>springfox-spring-webflux</artifactId> + <version>${springfox.swagger2.version}</version> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </exclusion> + </exclusions> + </dependency> + --> <!-- Common Utils Dependencies --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <version>3.2.1</version> + <version>${commons-lang3-version}</version> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> - <version>3.2.2</version> + <version>${commons-collections-version}</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>2.6</version> + <version>${commons-io-version}</version> </dependency> <dependency> <groupId>org.apache.velocity</groupId> @@ -161,6 +172,11 @@ <artifactId>jython-standalone</artifactId> <version>${jython.version}</version> </dependency> + <dependency> + <groupId>net.minidev</groupId> + <artifactId>json-smart</artifactId> + <version>${json-smart.version}</version> + </dependency> <!-- Kotlin Dependencies --> <dependency> @@ -254,7 +270,6 @@ <version>${protobuff.java.utils.version}</version> </dependency> - <!-- Adaptors --> <dependency> <groupId>org.apache.sshd</groupId> @@ -329,7 +344,6 @@ </exclusions> </dependency> - <!-- Blueprint Processor Application Module Dependencies --> <dependency> <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId> @@ -563,6 +577,10 @@ </exclusions> </dependency> <dependency> + <groupId>net.minidev</groupId> + <artifactId>json-smart</artifactId> + </dependency> + <dependency> <groupId>net.javacrumbs.json-unit</groupId> <artifactId>json-unit-json-path</artifactId> </dependency> @@ -580,10 +598,10 @@ </exclusion> </exclusions> </dependency> -<!-- <dependency>--> -<!-- <groupId>io.springfox</groupId>--> -<!-- <artifactId>springfox-spring-webflux</artifactId>--> -<!-- </dependency>--> + <!-- <dependency>--> + <!-- <groupId>io.springfox</groupId>--> + <!-- <artifactId>springfox-spring-webflux</artifactId>--> + <!-- </dependency>--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> |