Это мой пример класса, и я хочу протестировать его метод.
Код: Выделить всё
final class NavigationBuilder {
@VisibleForTesting List mIntentList = new ArrayList(5);
@VisibleForTesting
void addNextScreenBasedOnBookingStatus(final Booking booking) {
final ChatMsgDbAsyncHelper helper = new ChatMsgDbAsyncHelper();
if (booking == null) {
helper.cleanAllMessages(mContext); //
Подробнее здесь: [url]https://stackoverflow.com/questions/42291978/how-to-mock-a-void-method-with-powermockito[/url]
Мобильная версия