@Test
public void shouldParseWithFragment() throws Exception {
when(conversionService.fromJson(jsonObject("{\"type\":\"test\"}"), same(TestFragment.class))).thenReturn(fragment);
JSONObject json = new JSONObject("{\"com_cumulocity_me_rest_convert_TestFragment\":{\"type\":\"test\"},\"id\":\"testid\"}");
MeasurementRepresentation parsed = (MeasurementRepresentation) converter.fromJson(json);
assertThat(parsed.getId()).isEqualTo(id);
assertThat(parsed.getAttrs().size()).isEqualTo(1);
assertThat(parsed.get(TestFragment.class)).isSameAs(fragment);
}