File tree Expand file tree Collapse file tree
compiler/src/test/java/net/jbock/processor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,6 +286,25 @@ void validConvertToList() {
286286 .compilesWithoutError ();
287287 }
288288
289+ @ Test
290+ void invalidVarargsConverterReturnsList () {
291+ JavaFileObject javaFile = fromSource (
292+ "@Command" ,
293+ "abstract class Arguments {" ,
294+ "" ,
295+ " @VarargsParameter(converter = MyConverter.class)" ,
296+ " abstract List<Integer> something();" ,
297+ "" ,
298+ " static class MyConverter extends StringConverter<List<Integer>> {" ,
299+ " public List<Integer> convert(String token) { return null; }" ,
300+ " }" ,
301+ "}" );
302+ assertAbout (javaSources ()).that (singletonList (javaFile ))
303+ .processedWith (Processor .testInstance ())
304+ .failsToCompile ()
305+ .withErrorContaining ("invalid converter class: should extend StringConverter<Integer>" );
306+ }
307+
289308 @ Test
290309 void parameterInvalidList () {
291310 JavaFileObject javaFile = fromSource (
You can’t perform that action at this time.
0 commit comments