找到你要的答案

Q:What access modifier for testable helper methods?

Q:什么样的访问修饰符可测试的辅助方法?

In Java, helper methods are often marked protected instead of private, so that unit tests within the same package can test the helper methods. (Specifically, I am using JUnit.)

This does not seem to work in Kotlin. What access modifier is recommended instead?

在java中,辅助方法往往明显而不是私人保护,使同一包内的单元测试可以测试的辅助方法。(特别是,我使用JUnit。)

这似乎并没有在Kotlin工作。推荐什么访问修饰符?

answer1: 回答1:

internal (or no modifier) works well here

内部(或没有修饰符)在这里工作得很好

unit-testing  junit  packages  access-modifiers  kotlin