Skip to content

Commit 74351e1

Browse files
committed
[sb-@value] renaming
1 parent 474f5ed commit 74351e1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

spring-boot-kotlin/src/main/kotlin/com/baeldung/theValueAnnotation/MyMagicBeans.kt renamed to spring-boot-kotlin/src/main/kotlin/com/baeldung/theValueAnnotation/ValueBean.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import org.springframework.beans.factory.annotation.Value
44
import org.springframework.stereotype.Component
55

66
@Component
7-
class MyMagicBean(
7+
class ValueBean(
88
// without default values
99
@Value("\${my-app.magic-number}")
1010
val magicNumber: Int,

spring-boot-kotlin/src/test/kotlin/com/baeldung/theValueAnnotation/TheValueAnnotationUnitTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import kotlin.test.assertTrue
1010

1111
@SpringBootTest
1212
@TestConstructor(autowireMode = AutowireMode.ALL)
13-
class TheValueAnnotationUnitTest(val myMagicBean: MyMagicBean) {
13+
class TheValueAnnotationUnitTest(val valueBean: ValueBean) {
1414

1515
@Test
1616
fun `when using value annotations, then expected values should be injected`() {
17-
with(myMagicBean) {
17+
with(valueBean) {
1818
assertEquals(42, magicNumber)
1919
assertEquals("It's a magic string", magicString)
2020
assertTrue(magicFlag)
@@ -23,15 +23,15 @@ class TheValueAnnotationUnitTest(val myMagicBean: MyMagicBean) {
2323

2424
@Test
2525
fun `when using value annotations with default values, then expected values should be injected`() {
26-
with(myMagicBean) {
26+
with(valueBean) {
2727
assertEquals(1024, magicNumberWithDefault)
2828
assertEquals("It's another magic string", magicStringWithDefault)
2929
}
3030
}
3131

3232
@Test
3333
fun `when using value annotations with null as default values, then expected values should be injected`() {
34-
with(myMagicBean) {
34+
with(valueBean) {
3535
assertEquals("null", stringDefaultLiteralNull)
3636
assertNull(stringDefaultNull)
3737
}

0 commit comments

Comments
 (0)