CurrentRunStepIndexProvider implements DynamicPropertyResolver.ValueProvider { @Override public String getValue(PropertyExpansionContext context) { if( context instanceof TestRunContext) { TestRunner runner = ((TestRunContext) context).getTestRunner(); if( runner instanceof AbstractTestCaseRunner) return String.valueOf(((AbstractTestCaseRunner)runner).getResultCount()); } return null; }  @Override String getValue(PropertyExpansionContext context);  }
@Test public void testProvider() { CurrentRunStepIndexProvider provider = new CurrentRunStepIndexProvider(); WsdlTestRunContext context = Mockito.mock(WsdlTestRunContext.class); AbstractTestCaseRunner runner = Mockito.mock(AbstractTestCaseRunner.class); Mockito.when( runner.getResultCount()).thenReturn( 3 ); Mockito.when( context.getTestRunner()).thenReturn(runner); Assert.assertEquals( "3", provider.getValue( context )); }