### Question:
AnalyzerInfoService { @GET @Path( "/entries" ) @Produces( { MediaType.APPLICATION_JSON } ) @StatusCodes( { @ResponseCode( code = OK, condition = "Successfully listed the supported job entries" ), @ResponseCode( code = SERVER_ERROR, condition = "Server Error." ) } ) public Response getSupportedJobEntries() { List<AnalyzerInfo> analyzers = new ArrayList<>(); for ( IJobEntryAnalyzer analyzer : getJobEntryAnalyzerProvider().getAnalyzers() ) { Set<Class<? extends JobEntryInterface>> supportedEntries = analyzer.getSupportedEntries(); for ( Class<? extends JobEntryInterface> supportedEntry : supportedEntries ) { AnalyzerInfo info = new AnalyzerInfo( supportedEntry.getSimpleName() ); analyzers.add( info ); } } Collections.sort( analyzers, new AnalyzerInfoComparator() ); return Response.ok( analyzers ).build(); }  IStepAnalyzerProvider getStepAnalyzerProvider(); void setStepAnalyzerProvider( IStepAnalyzerProvider stepAnalyzerProvider ); IJobEntryAnalyzerProvider getJobEntryAnalyzerProvider(); void setJobEntryAnalyzerProvider( IJobEntryAnalyzerProvider jobEntryAnalyzerProvider ); @GET @Path( "/steps" ) @Produces( { MediaType.APPLICATION_JSON } ) @StatusCodes( { @ResponseCode( code = OK, condition = "Successfully listed the supported steps" ), @ResponseCode( code = SERVER_ERROR, condition = "Server Error." ) } ) Response getSupportedSteps(); @GET @Path( "/entries" ) @Produces( { MediaType.APPLICATION_JSON } ) @StatusCodes( { @ResponseCode( code = OK, condition = "Successfully listed the supported job entries" ), @ResponseCode( code = SERVER_ERROR, condition = "Server Error." ) } ) Response getSupportedJobEntries(); static final int OK; static final int SERVER_ERROR; }### Answer:
@Test public void testGetSupportedEntries() throws Exception { List<IJobEntryAnalyzer> analyzers = new ArrayList<>(); final TransJobEntryAnalyzer transJobEntryAnalyzer = new TransJobEntryAnalyzer(); analyzers.add( transJobEntryAnalyzer ); when( jobEntryAnalyzerProvider.getAnalyzers() ).thenReturn( analyzers ); Response supportedJobEntries = service.getSupportedJobEntries(); assertEquals( Response.Status.OK.getStatusCode(), supportedJobEntries.getStatus() ); assertNotNull( supportedJobEntries.getEntity() ); assertTrue( supportedJobEntries.getEntity() instanceof List ); List<AnalyzerInfo> responseList = (List<AnalyzerInfo>) supportedJobEntries.getEntity(); assertEquals( analyzers.size(), responseList.size() ); assertEquals( transJobEntryAnalyzer.getSupportedEntries().iterator().next().getSimpleName(), responseList.get( 0 ).getMeta() ); }