I'm having unit test checking my function that receive varargs of String.
In the function i'm checking if the parameter sent is null:
public static String generate(String... input) {
if (input == null) {
LOGGER.warn("Input is null for CheckSumGenerator");
return null;
}
// Other not relevant code here
}
Unit test:
String checkSum2 = CheckSumGenerator.generate(null);
Assert.assertEquals(checkSum2, null);
When using Maven as build tool - test run fine. Passed. When change the project to run with gradle the build print warning in red:
warning: non-varargs call of varargs method with inexact argument type for last parameter
The question is why gradle print it and maven isn't?