TimeZoneResource { @GET @ApiOperation(value = "Get supported timezones", response = String.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of timezones. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) public StringListDTO getTimeZones() { StringListDTO timeZones = new StringListDTO(); Collections.addAll(timeZones, TimeZone.getAvailableIDs()); return timeZones; } TimeZoneResource(); @GET @ApiOperation(value = "Get supported timezones", response = String.class, responseContainer = "List") @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful retrieval of timezones. It can be an empty list."), @ApiResponse(code = 401, message = "Unauthorized"), @ApiResponse(code = 500, message = "Internal server error") }) @Produces(MediaType.APPLICATION_JSON) StringListDTO getTimeZones();  }
@Test public void getTimeZonesTest() { List<String> timeZones = timeZoneResource.getTimeZones(); Assert.assertFalse(timeZones.isEmpty()); List<String> availableTimeZones = Arrays.asList(TimeZone.getAvailableIDs()); Collection intersection = CollectionUtils.intersection(timeZones, availableTimeZones); Assert.assertEquals(timeZones.size(),intersection.size()); }