/** * Akin to {@link JenkinsRule#configRoundtrip(Builder)}. * * @param <S> step type * @param before the incoming step * @return the result after displaying in a form and resaving */ @SuppressWarnings("unchecked") public <S extends Step> S configRoundTrip(S before) throws Exception { FreeStyleProject p = rule.createFreeStyleProject(); p.getBuildersList().add(new StepBuilder(before)); // workaround for eclipse compiler Ambiguous method call p = (FreeStyleProject) rule.configRoundtrip((Item) p); StepBuilder b = p.getBuildersList().get(StepBuilder.class); assertNotNull(b); Step after = b.s; assertNotNull(after); assertEquals(before.getClass(), after.getClass()); return (S) after; }