BAEL-2651 Implement Java static methods equivalent (#6322)
This commit is contained in:
parent
0e178fe9c9
commit
cf72052df5
|
@ -0,0 +1,10 @@
|
|||
package com.baeldung.static
|
||||
|
||||
class ConsoleUtils {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun debug(debugMessage : String) {
|
||||
println("[DEBUG] $debugMessage")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.baeldung.static
|
||||
|
||||
fun debug(debugMessage : String) {
|
||||
println("[DEBUG] $debugMessage")
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.baeldung.static
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
class ConsoleUtilsUnitTest {
|
||||
@Test
|
||||
fun givenAStaticMethod_whenCalled_thenNoErrorIsThrown() {
|
||||
ConsoleUtils.debug("test message")
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.baeldung.static
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
class LoggingUtilsUnitTest {
|
||||
@Test
|
||||
fun givenAPackageMethod_whenCalled_thenNoErrorIsThrown() {
|
||||
debug("test message")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue