@Override public Publisher newInstance(StaplerRequest req, JSONObject formData) throws FormException { DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>> testDataPublishers = new DescribableList<TestDataPublisher, Descriptor<TestDataPublisher>>(Saveable.NOOP); try { testDataPublishers.rebuild(req, formData, TestDataPublisher.all()); } catch (IOException e) { throw new FormException(e, null); } return new FixedMavenTestDataPublisher(testDataPublishers); }
@SuppressWarnings("rawtypes") @Override public boolean isApplicable(Class<? extends AbstractProject> jobType) { return MavenModuleSet.class.isAssignableFrom(jobType) && !TestDataPublisher.all().isEmpty(); }