Custom Input Annotations
Custom input annotations allow particular inputs to be recommended to Diffblue Cover when writing tests.
Using @InTestsUseStrings
public static boolean isDayRelatedSongTitle(@InTestsUseStrings({"I Don't Like Mondays", "Here Comes The Weekend"}) String title) {
return Stream.of(DayOfWeek.values())
.map(DayOfWeek::name)
.map(String::toLowerCase)
.anyMatch(title.toLowerCase()::contains);
}Using @InTestsUseIntegers
public static String toUpperHexString(@InTestsUseIntegers(0xD1FFB) int input) {
return Long.toHexString(input).toUpperCase();
}Using @InTestsUseShorts
public static String toUpperHexString(@InTestsUseShorts((short) 0xD1FF) short input) {
return Long.toHexString(input).toUpperCase();
}Using @InTestsUseLongs
Using @InTestsUseBytes
Using @InTestsUseFloats
Using @InTestsUseDoubles
Using @InTestsUseEnums
Using @InTestsUseClasses
Using @InTestsUseCharacters
Using @InTestsUseFactories
Last updated
Was this helpful?

