@Test void testMapEntityRefNull() throws URISyntaxException { HttpServletRequest request = mock(HttpServletRequest.class); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request)); when(request.getRequestURI()).thenReturn("/api/data/EntityType"); when(request.getScheme()).thenReturn("http"); when(request.getServerName()).thenReturn("localhost"); when(request.getServerPort()).thenReturn(80); Entity entity = createMockEntity(XREF); doReturn(null).when(entity).getEntity("attr"); URI entitySelf = new URI("http: EntityResponse expectedEntityResponse = EntityResponse.builder() .setLinks(LinksResponse.create(null, entitySelf, null)) .setData(singletonMap("attr", null)) .build(); URI entitiesPrevious = new URI("http: URI entitiesSelf = new URI("http: URI entitiesNext = new URI("http: EntitiesResponse expectedEntitiesResponse = EntitiesResponse.builder() .setLinks(LinksResponse.create(entitiesPrevious, entitiesSelf, entitiesNext)) .setItems(singletonList(expectedEntityResponse)) .build(); EntityCollection entityCollection = EntityCollection.builder() .setEntityTypeId("EntityType") .setEntities(singletonList(entity)) .build(); assertEquals( expectedEntitiesResponse, entityMapper.map(entityCollection, FULL_SELECTION, FULL_SELECTION, 10, 1, 100)); }
@Override public EntityResponse map(Entity entity, Selection filter, Selection expand) { return mapRecursive(entity, filter, expand, 0); }
EntityMapperImpl implements EntityMapper { @Override public EntityResponse map(Entity entity, Selection filter, Selection expand) { return mapRecursive(entity, filter, expand, 0); } }
EntityMapperImpl implements EntityMapper { @Override public EntityResponse map(Entity entity, Selection filter, Selection expand) { return mapRecursive(entity, filter, expand, 0); }  }
EntityMapperImpl implements EntityMapper { @Override public EntityResponse map(Entity entity, Selection filter, Selection expand) { return mapRecursive(entity, filter, expand, 0); }  @Override EntityResponse map(Entity entity, Selection filter, Selection expand); @Override EntitiesResponse map(
      EntityCollection entityCollection,
      Selection filter,
      Selection expand,
      int size,
      int number,
      int total); }
EntityMapperImpl implements EntityMapper { @Override public EntityResponse map(Entity entity, Selection filter, Selection expand) { return mapRecursive(entity, filter, expand, 0); }  @Override EntityResponse map(Entity entity, Selection filter, Selection expand); @Override EntitiesResponse map(
      EntityCollection entityCollection,
      Selection filter,
      Selection expand,
      int size,
      int number,
      int total);  }