@Test public void parseShouldInstantiateDestinationClass() throws Exception { String field1 = "value1"; String field2 = "value2"; Request request = jsonExtractor.parse("{\"field1\":\"" + field1 + "\",\"field2\":\"" + field2 + "\"}"); assertThat(request.getField1()).isEqualTo(field1); assertThat(request.getField2()).isEqualTo(field2); }
public RequestT parse(String text) throws JsonExtractException { try { return objectMapper.readValue(text, type); } catch (IOException | IllegalArgumentException e) { throw new JsonExtractException(e); } }
JsonExtractor { public RequestT parse(String text) throws JsonExtractException { try { return objectMapper.readValue(text, type); } catch (IOException | IllegalArgumentException e) { throw new JsonExtractException(e); } } }
JsonExtractor { public RequestT parse(String text) throws JsonExtractException { try { return objectMapper.readValue(text, type); } catch (IOException | IllegalArgumentException e) { throw new JsonExtractException(e); } } JsonExtractor(Class<RequestT> type, Module... modules);  JsonExtractor(Class<RequestT> type, List<Module> modules); }
JsonExtractor { public RequestT parse(String text) throws JsonExtractException { try { return objectMapper.readValue(text, type); } catch (IOException | IllegalArgumentException e) { throw new JsonExtractException(e); } } JsonExtractor(Class<RequestT> type, Module... modules);  JsonExtractor(Class<RequestT> type, List<Module> modules); RequestT parse(String text); }
JsonExtractor { public RequestT parse(String text) throws JsonExtractException { try { return objectMapper.readValue(text, type); } catch (IOException | IllegalArgumentException e) { throw new JsonExtractException(e); } } JsonExtractor(Class<RequestT> type, Module... modules);  JsonExtractor(Class<RequestT> type, List<Module> modules); RequestT parse(String text);  }