Brais Gabin
08/31/2021, 4:48 PM@Test
function doesn't return Unit
JUnit will not execute it? But, no one returns something in those functions, right? Well... if you uses coroutines and follow this pattern in your tests: @Test fun foo() = runBlocking { ... }
your tests are not executed at all. Give the custom rule a try if you want 🙂. All feedback is more than welcome.ephemient
08/31/2021, 7:29 PM@Test
fun test() = run {
assertTrue(true)
}
should be okBrais Gabin
09/01/2021, 6:20 AMmarschwar
09/23/2021, 10:35 AM@AnalyzeClasses(packages = "<http://com.company.my|com.company.my>")
class ArchUnitTest {
@ArchTest
val returnVoidRule = methods()
.that().areAnnotatedWith(Test.class)
.should().haveRawReturnType("void");
}
Since junit obviously is used in your case, it would be really simple to set it up.Brais Gabin
09/24/2021, 1:12 PM