Skip to content

Commit

Permalink
♻ : convert test to Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
juwit committed Apr 12, 2021
1 parent 4945c00 commit 70a5ba0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 37 deletions.
37 changes: 0 additions & 37 deletions src/test/java/io/gaia_app/stacks/bo/StackTest.java

This file was deleted.

31 changes: 31 additions & 0 deletions src/test/java/io/gaia_app/stacks/bo/StackTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.gaia_app.stacks.bo

import io.gaia_app.modules.bo.TerraformModule
import io.gaia_app.modules.bo.Variable
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.Test

internal class StackTest {

@Test
fun tfvars_shouldGenerateTfvarContents() {
// given
val variableWithDefault = Variable("variableWithDefault", "string", "a variable with a default value", "myValue")
val mandatoryVariable = Variable("mandatoryVariable", "string", "a variable with a default value", null, true, true)

val module = TerraformModule()
module.variables = listOf(variableWithDefault, mandatoryVariable)

val stack = Stack()
stack.module = module
stack.variableValues = mapOf("mandatoryVariable" to "myOtherValue")

// when
val tfvars = stack.tfvars()

// then
Assertions.assertThat(tfvars)
.contains("variableWithDefault = \"myValue\"\n")
.contains("mandatoryVariable = \"myOtherValue\"\n")
}
}

0 comments on commit 70a5ba0

Please sign in to comment.