@Test
public void getModuleDependencies() {

    final DbModule dbModule = new DbModule();
    dbModule.setName("moduleTest");
    dbModule.setVersion("1.0.0");
    final DbArtifact dbArtifact = new DbArtifact();
    dbArtifact.setGroupId(GrapesTestUtils.CORPORATE_GROUPID_4TEST);
    dbArtifact.setArtifactId("artifact1");
    dbArtifact.setVersion("1.2.3");
    dbModule.addDependency(dbArtifact.getGavc(), Scope.COMPILE);
    when(repositoryHandler.getModule(dbModule.getId())).thenReturn(dbModule);
    when(repositoryHandler.getArtifact(dbArtifact.getGavc())).thenReturn(dbArtifact);
    final WebResource resource = client().resource("/" + ServerAPI.MODULE_RESOURCE + "/" + dbModule.getName() + "/" + dbModule.getVersion() + ServerAPI.GET_DEPENDENCIES);
    final ClientResponse response = resource.queryParam(ServerAPI.SCOPE_COMPILE_PARAM, "true")
            .queryParam(ServerAPI.SHOW_THIRPARTY_PARAM, "true")
            .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
    assertNotNull(response);
    assertEquals(HttpStatus.OK_200, response.getStatus());
    final List<Dependency> results = response.getEntity(new GenericType<List<Dependency>>() {
    });
    assertNotNull(results);
    assertEquals(1, results.size());
    assertEquals(dbArtifact.getGavc(), results.get(0).getTarget().getGavc());
    assertEquals(Scope.COMPILE, results.get(0).getScope());
    assertEquals(dbModule.getName(), results.get(0).getSourceName());
    assertEquals(dbModule.getVersion(), results.get(0).getSourceVersion());
}