Field field = Test.class.getDeclaredField("json");
//When
final Codec codec = factory.parseSimpleField(createContext(field));
final String encoded = (String) codec.encode(bean);
final Pojo decoded = (Pojo) codec.decode("{\"id\":11,\"name\":\"John\"}");
//Then
assertThat(encoded).isEqualTo("{\"id\":10,\"name\":\"DuyHai\"}");
assertThat(decoded.getId()).isEqualTo(11L);
assertThat(decoded.getName()).isEqualTo("John");