public String getJobName() {
        if (isBuilding()) {
            try {
                return buildLocator.split("/")[4];
            } catch (ArrayIndexOutOfBoundsException e) {
                return null;
            }
        }
        return null;
    }
@Test
    public void shouldReturnTheJobName() {
        AgentBuildingInfo agentBuildingInfo = new AgentBuildingInfo("buildInfo", "foo/1/bar/3/job");
        assertThat(agentBuildingInfo.getJobName(), is("job"));
    }