### Question:
PlayerResource { @GET @ApiOperation(value = "Gets information about the current player", authorizations = { @Authorization("basicAuth") }) public PlayerResponse me(@Auth @ApiParam(access = "internal") Player player) { List<Planet> planets = planetService.findWithOwner(player); Optional<Points> points = pointsService.getPointsForPlayer(player); return new PlayerResponse( player.getUsername(), Functional.mapToList(planets, PlanetMapper::fromPlanet), points.map(PointsMapper::fromPoints).orElse(new PointResponse(0, 0)) ); } @Inject  PlayerResource(PlayerService playerService, PlanetService planetService, PlayerAuthenticationCache playerAuthenticationCache, PointsService pointsService); @GET @ApiOperation(value = "Gets information about the current player", authorizations = { @Authorization("basicAuth") }) PlayerResponse me(@Auth @ApiParam(access = "internal") Player player); @POST @ApiOperation("Registers a new player") Response register(@Valid RegisterPlayerRequest registration); @GET @Path("/points") @ApiOperation(value = "Returns points over time for the current player", authorizations = { @Authorization("basicAuth") }) PointsResponse points(@Auth @ApiParam(access = "internal") Player player); @GET @Path("/ranking") @ApiOperation(value = "Returns the player ranking") PlayerRankingResponse playerRanking(@QueryParam("max") @DefaultValue("100") int max);  }### Answer:
@Test public void testMe() throws Exception { when(planetService.findWithOwner(Data.Player1.PLAYER)).thenReturn(Collections.singletonList(Data.Player1.Planet1.PLANET)); when(pointsService.getPointsForPlayer(Data.Player1.PLAYER)).thenReturn(Optional.<Points>empty()); PlayerResponse response = request(resources, URL).get(PlayerResponse.class); assertThat(response.getUsername(), is("username")); List<PlanetResponse> planets = response.getPlanets(); assertThat(planets, hasSize(1)); assertThat(planets.get(0), is(new PlanetResponse("1.1.1", 100, 200, 300, 1))); }