@Test
public void postModule() throws UnknownHostException, AuthenticationException {

    final Module module = DataModelFactory.createModule("module", "1.0.0-SNAPSHOT");
    final Artifact artifact = DataModelFactory.createArtifact(GrapesTestUtils.CORPORATE_GROUPID_4TEST, "artifactId", "version", "classifier", "type", "extension");
    module.addArtifact(artifact);
    client().addFilter(new HTTPBasicAuthFilter(GrapesTestUtils.USER_4TEST, GrapesTestUtils.PASSWORD_4TEST));
    final WebResource resource = client().resource("/" + ServerAPI.MODULE_RESOURCE);
    final ClientResponse response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class, module);
    assertNotNull(response);
    assertEquals(HttpStatus.CREATED_201, response.getStatus());
    final ArgumentCaptor<DbModule> captor = ArgumentCaptor.forClass(DbModule.class);
    verify(repositoryHandler, times(1)).store(captor.capture());
    verify(repositoryHandler, times(1)).store((DbArtifact) anyObject());
    assertEquals(GrapesTestUtils.ORGANIZATION_NAME_4TEST, captor.getValue().getOrganization());
}