class TeamCityConnection implements BuildCapability, TestCapability, ViewCapability {

    @Override
    public String getMavenId(SoftwareProjectId softwareProjectId) throws ProjectNotFoundException,
            MavenIdNotFoundException {
        checkConnected();
        checkSoftwareProjectId(softwareProjectId);
        String projectId = softwareProjectId.getProjectId();
        try {
            return teamCity.findMavenId(projectId);
        } catch (fr.norad.visuwall.providers.common.MavenIdNotFoundException e) {
            throw new MavenIdNotFoundException("Cannot find maven id for " + softwareProjectId, e);
        }
    }

}

class TeamCityConnectionTest {

     TeamCityConnection teamCityConnection;
    @Mock TeamCity teamCity;

    @Test
    public void should_throw_exception_when_getting_maven_id() throws Exception {

        SoftwareProjectId softwareProjectId = softwareProjectId();
        String projectId = softwareProjectId.getProjectId();
        when(teamCity.findMavenId(projectId)).thenReturn("groupId:artifactId");

        String mavenId = teamCityConnection.getMavenId(softwareProjectId);

        assertEquals("groupId:artifactId", mavenId);
    }

}