Coverage Cannot Cover Publicly Available Static Invalid Core Method

Using Junit coverage, it cannot span the public static void method. How can I cover it?

+3
source share
2 answers

After verifying that this can be verified, simply name it like any other public static method:

YourClass.main(new String[] {"parameter 1", "parameter 2"});

And then confirm the following status.

+4
source

Since it does not return anything, you cannot check the output. But what is he doing? If it calls another method, write a test for this method. If he does not call other methods, write a test for this.

0
source

Source: https://habr.com/ru/post/1749891/


All Articles