PipelineMetadataService implements ApiRoutable { @GET @TreeResponse public ExportedPipelineStep[] doWrapperMetadata() { List<ExportedPipelineStep> wrappers = new ArrayList<>(); for (StepDescriptor d : StepDescriptor.all()) { if (isWrapper(d)) { ExportedPipelineStep step = getStepMetadata(d); if (step != null) { wrappers.add(step); } } } return wrappers.toArray(new ExportedPipelineStep[wrappers.size()]); }  @Override String getUrlName(); @GET String doCrumbInfo(); @GET @TreeResponse ExportedDescribableModel[] doAgentMetadata(); @GET @TreeResponse ExportedToolDescriptor[] doToolMetadata(); @GET @TreeResponse ExportedBuildCondition[] doBuildConditions(); @GET @TreeResponse ExportedPipelineStep[] doWrapperMetadata(); @GET @TreeResponse ExportedPipelineFunction[] doPipelineStepMetadata();  }
@Test public void wrappers() throws Exception { PipelineMetadataService svc = new PipelineMetadataService(); List<ExportedPipelineStep> wrappers = new ArrayList<>(); wrappers.addAll(Arrays.asList(svc.doWrapperMetadata())); assertFalse(wrappers.isEmpty()); ExportedPipelineStep w = null; for (ExportedPipelineStep s : wrappers) { if (s.getFunctionName().equals("timeout")) { w = s; } } assertNotNull(w); }