PrimitiveTypeProducer extends BaseTypeProducer { @Override protected Object createValue(String value) throws Exception { Class<?> c = PRIMITIVE_TYPES_MAP.get(clazz.getName()); Method stringValueOfMethod = ReflectionUtils.getStringValueOfMethod(c); return stringValueOfMethod.invoke(null, value); } PrimitiveTypeProducer(Class<?> clazz); @Override Object createValue(String param, MultivaluedMap<String, String> values, String defaultValue);  }
@UseDataProvider("testData") @Test public void createsPrimitiveValue(Class<?> primitiveTypeWrapper, MultivaluedMap<String, String> values, String defaultValue, Object expected) throws Exception { PrimitiveTypeProducer producer = new PrimitiveTypeProducer(primitiveTypeWrapper); Object result = producer.createValue("value", values, defaultValue); assertEquals(expected, result); }