FailoverNode { public Integer getItemByExecutionFailoverPath(final String path) { if (!isFailoverPath(path)) { return null; } return Integer.parseInt(path.substring(jobNodePath.getFullPath(ExecutionNode.ROOT).length() + 1, path.lastIndexOf(FailoverNode.FAILOVER) - 1)); } FailoverNode(final String jobName); Integer getItemByExecutionFailoverPath(final String path);  }
@Test public void assertGetItemWhenNotExecutionFailoverPath() { assertNull(failoverNode.getItemByExecutionFailoverPath("/testJob/execution/0/completed")); }
@Test public void assertGetItemByExecutionFailoverPath() { assertThat(failoverNode.getItemByExecutionFailoverPath("/testJob/execution/0/failover"), is(0)); }