From 3ee9050138e10a087562d4b410d9d9eb7de158b4 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Fri, 16 Nov 2018 10:18:14 +0800 Subject: [PATCH] change from @before to init --- .../test/kotlin/com/baeldung/random/RandomStringTest.kt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt index a2a1ac58e3..3c7bc44ea8 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt +++ b/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringTest.kt @@ -13,14 +13,7 @@ const val STRING_LENGTH = 10 const val ALPHANUMERIC_REGEX = "[a-zA-Z0-9]+" class RandomStringTest { - - private val charPool = ArrayList() - - init { - charPool.addAll('a'..'z') - charPool.addAll('A'..'Z') - charPool.addAll('0'..'9') - } + private val charPool : List = ('a'..'z') + ('A'..'Z') + ('0'..'9') @Test fun givenAStringLength_whenUsingJava_thenReturnAlphanumericString() {