public <T> T get(Class<T> desiredType, int index) { return valueEncoder.toValue(desiredType, values[index]); } }
public <T> T toValue(Class<T> requiredType, String clientValue) { return contextValueEncoder.toValue(requiredType, clientValue); }
@Test public void to_value() { ValueEncoder valueEncoder = mockValueEncoder(); ValueEncoderSource source = mockValueEncoderSource(); Long value = 23L; String clientValue = "twentythree"; train_getValueEncoder(source, Long.class, valueEncoder); train_toValue(valueEncoder, clientValue, value); replay(); ContextValueEncoder cve = new ContextValueEncoderImpl(source); assertSame(cve.toValue(Long.class, clientValue), value); verify(); }