Код: Выделить всё
SoftAssertionsКод: Выделить всё
final SoftAssertions softly = new SoftAssertions();
softly.assertThat("foo").hasToString("foo");
softly.assertThat("bar").hasToString("bar");
softly.assertAll();
Код: Выделить всё
final SoftAssertions softly = new SoftAssertions();
final ForkJoinPool forkJoinPool = ForkJoinPool.commonPool();
forkJoinPool.execute(() -> {
softly.assertThat("foo").hasToString("foo");
});
forkJoinPool.execute(() -> {
softly.assertThat("bar").hasToString("bar");
});
softly.assertAll();
Защита SoftAssertions с помощью синхронизированного блокировать везде, где я их использую, не кажется хорошим решением (особенно с точки зрения читаемости теста).
Подробнее здесь: https://stackoverflow.com/questions/619 ... le-threads
Мобильная версия