2021-12-06から1日間の記事一覧

Put "open" to your class and its method when you get a NullPointerException by mocking your class by Mockito.

Problem When you have MyClass and try to write a test by mocking MyClass as the following, you will get an NPE: MyClass: open class MyClass { fun createList(string: String): List<String> { return listOf("A", "B", "C", string) } } Mocking MyClass b</string>…