@Test(dataProvider = "complex") public void internalSessionDeserialisationWorks(String path) throws Exception { InternalSession is = SERIALISATION.deserialise(getJSON(path), InternalSession.class); assertThat(is).isNotNull(); assertThat(is.getID()).isNotNull(); assertThat(Collections.list(is.getPropertyNames())).hasSize(23); }
public <T> T deserialise(String text, Class<T> clazz) { try { T value = mapper.readValue(text, clazz); return value; } catch (IOException e) { throw new IllegalStateException( MessageFormat.format( "Failed to deserailise {0}", clazz.getSimpleName()), e); } }
JSONSerialisation { public <T> T deserialise(String text, Class<T> clazz) { try { T value = mapper.readValue(text, clazz); return value; } catch (IOException e) { throw new IllegalStateException( MessageFormat.format( "Failed to deserailise {0}", clazz.getSimpleName()), e); } } }
JSONSerialisation { public <T> T deserialise(String text, Class<T> clazz) { try { T value = mapper.readValue(text, clazz); return value; } catch (IOException e) { throw new IllegalStateException( MessageFormat.format( "Failed to deserailise {0}", clazz.getSimpleName()), e); } } JSONSerialisation(); }
JSONSerialisation { public <T> T deserialise(String text, Class<T> clazz) { try { T value = mapper.readValue(text, clazz); return value; } catch (IOException e) { throw new IllegalStateException( MessageFormat.format( "Failed to deserailise {0}", clazz.getSimpleName()), e); } } JSONSerialisation(); String serialise(T object); T deserialise(String text, Class<T> clazz); static String jsonAttributeName(String name); }
JSONSerialisation { public <T> T deserialise(String text, Class<T> clazz) { try { T value = mapper.readValue(text, clazz); return value; } catch (IOException e) { throw new IllegalStateException( MessageFormat.format( "Failed to deserailise {0}", clazz.getSimpleName()), e); } } JSONSerialisation(); String serialise(T object); T deserialise(String text, Class<T> clazz); static String jsonAttributeName(String name);  }