ArgumentConvertor implements IArgumentConvertor { void checkStringArgument(Class cls, String arg) throws IOException { if (arg.startsWith(Constants.QUOTE)) { if (!cls.equals(String.class)) { throw new IOException(); } } else if (cls.equals(String.class)) { throw new IOException(); } }  @Override Object convertJsonToJava(String jsonArg, Type paramType, Annotation[] parameterAnnotations);  }
@Test public void testCheckArgumentOk() throws IOException { System.out.println("checkArgument"); instance.checkStringArgument(String.class, "\"toto\""); instance.checkStringArgument(Integer.class, "5"); }
@Test(expected = IOException.class) public void testCheckArgumentNok1() throws IOException { System.out.println("checkArgument"); instance.checkStringArgument(String.class, "toto"); }
@Test(expected = IOException.class) public void testCheckArgumentNok2() throws IOException { System.out.println("checkArgument"); instance.checkStringArgument(Integer.class, "\"5\""); }