HiveModelReader implements ModelReader<HiveRoad> { @Override public HiveRoad read(JsonNode json) { return mapper.convertValue(json, HiveRoad.class); } @Autowired  HiveModelReader(ObjectMapper mapper); @Override HiveRoad read(JsonNode json);  }
@Test public void test() { when(mapper.convertValue(json, HiveRoad.class)).thenReturn(road); HiveRoad result = underTest.read(json); assertThat(result, is(road)); }