@Test public void createRepositoryNoAccessTest() throws Exception { String repoId = "test-repo"; RepositoryBaseResource repo = this.repoUtil.getRepository(this.getTestRepositoryId()); repo.setId(repoId); // use test user TestContainer.getInstance().getTestContext().setUsername(TEST_USER_NAME); TestContainer.getInstance().getTestContext().setPassword(TEST_USER_PASSWORD); Response response = this.repoUtil.sendMessage(Method.POST, repo, repoId); Assert.assertEquals("Status: " + response.getStatus(), response.getStatus().getCode(), 403); }