aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintErrorTest.kt
blob: 167c0381abb32b9b1c57b2d710849c02ad668812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package org.onap.ccsdk.cds.controllerblueprints.core

import org.junit.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue

class BluePrintErrorTest {

    @Test
    fun testBluePrintErrorIsCreatedWithemptyList() {
        val bluePrintError = BluePrintError()

        assertTrue(bluePrintError.allErrors().isEmpty())
    }

    @Test
    fun testAddErrorWith3Params() {
        val bluePrintError = BluePrintError()

        bluePrintError.addError("type", "name", "error", "step")

        assertEquals("type : name : error", bluePrintError.stepErrors("step")!![0])
    }

    @Test
    fun testAddErrorWith2Params() {
        val bluePrintError = BluePrintError()

        bluePrintError.addError("error", "step")

        assertEquals("error", bluePrintError.stepErrors("step")!![0])
    }
}