### Question:
AnalyzerInfoService { @GET @Path( "/steps" ) @Produces( { MediaType.APPLICATION_JSON } ) @StatusCodes( { @ResponseCode( code = OK, condition = "Successfully listed the supported steps" ), @ResponseCode( code = SERVER_ERROR, condition = "Server Error." ) } ) public Response getSupportedSteps() { List<AnalyzerInfo> analyzers = new ArrayList<>(); for ( IStepAnalyzer analyzer : getStepAnalyzerProvider().getAnalyzers() ) { Set<Class<? extends BaseStepMeta>> supportedSteps = analyzer.getSupportedSteps(); for ( Class<? extends BaseStepMeta> supportedStep : supportedSteps ) { AnalyzerInfo info = new AnalyzerInfo( supportedStep.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 testGetSupportedSteps() throws Exception { List<IStepAnalyzer> analyzers = new ArrayList<>(); final StringsCutStepAnalyzer stringsCutStepAnalyzer = new StringsCutStepAnalyzer(); final MergeJoinStepAnalyzer mergeJoinStepAnalyzer = new MergeJoinStepAnalyzer(); analyzers.add( stringsCutStepAnalyzer ); analyzers.add( mergeJoinStepAnalyzer ); when( stepAnalyzerProvider.getAnalyzers() ).thenReturn( analyzers ); Response supportedSteps = service.getSupportedSteps(); assertEquals( Response.Status.OK.getStatusCode(), supportedSteps.getStatus() ); assertNotNull( supportedSteps.getEntity() ); assertTrue( supportedSteps.getEntity() instanceof List ); List<AnalyzerInfo> responseList = (List<AnalyzerInfo>) supportedSteps.getEntity(); assertEquals( analyzers.size(), responseList.size() ); assertEquals( mergeJoinStepAnalyzer.getSupportedSteps().iterator().next().getSimpleName(), responseList.get( 0 ).getMeta() ); assertEquals( stringsCutStepAnalyzer.getSupportedSteps().iterator().next().getSimpleName(), responseList.get( 1 ).getMeta() ); }