CurrentStepIndexProvider implements DynamicPropertyResolver.ValueProvider { @Override public String getValue(PropertyExpansionContext context) { if( context instanceof TestCaseRunContext ) { return String.valueOf( ((TestCaseRunContext)context).getCurrentStepIndex()); } return null; }  @Override String getValue(PropertyExpansionContext context);  }
@Test public void testProvider() { CurrentStepIndexProvider provider = new CurrentStepIndexProvider(); TestCaseRunContext context = Mockito.mock(TestCaseRunContext.class); Mockito.when( context.getCurrentStepIndex()).thenReturn( 3 ); Assert.assertEquals( "3", provider.getValue( context )); }