2 * Copyright © 2018-2019 AT&T Intellectual Property.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.ccsdk.cds.blueprintsprocessor.ssh
20 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
21 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipTypeConnectsTo
22 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate
23 import kotlin.test.assertEquals
24 import kotlin.test.assertNotNull
26 class SshPropertiesDSLTest {
29 fun testSshPropertiesDSL() {
30 val serviceTemplate = serviceTemplate("ssh-properties-test", "1.0.0", "xxx.@xx.com", "ssh") {
32 relationshipTemplateSshClient("sample-basic-auth", "SSH Connection") {
34 username("sample-user")
35 password("sample-password")
43 BluePrintTypes.relationshipTypeConnectsToSshClient(),
44 BluePrintTypes.relationshipTypeConnectsTo()
49 assertNotNull(serviceTemplate, "failed to create service template")
50 val relationshipTemplates = serviceTemplate.topologyTemplate?.relationshipTemplates
51 assertNotNull(relationshipTemplates, "failed to get relationship templates")
52 assertEquals(1, relationshipTemplates.size, "relationshipTemplates doesn't match")
53 assertNotNull(relationshipTemplates["sample-basic-auth"], "failed to get sample-basic-auth")
54 // println(serviceTemplate.asJsonString(true))