use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.
the class RResourceIT method updateHosted_noAuthc.
@Test
public void updateHosted_noAuthc() throws Exception {
setBadCredentials();
AbstractRepositoryApiRequest request = createHostedRequest(false);
Response response = put(getUpdateRepositoryPathUrl(HostedType.NAME, HOSTED_NAME), request);
assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
}
use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.
the class RResourceIT method createProxy.
@Test
public void createProxy() throws Exception {
AbstractRepositoryApiRequest request = createProxyRequest(true);
Response response = post(getCreateRepositoryPathUrl(ProxyType.NAME), request);
assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
Repository repository = repositoryManager.get(request.getName());
assertNotNull(repository);
assertEquals(RFormat.NAME, repository.getFormat().getValue());
assertEquals(ProxyType.NAME, repository.getType().getValue());
repositoryManager.delete(request.getName());
}
use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.
the class RResourceIT method createGroup_noAuthz.
@Test
public void createGroup_noAuthz() throws Exception {
setUnauthorizedUser();
AbstractRepositoryApiRequest request = createGroupRequest(true);
Response response = post(getCreateRepositoryPathUrl(GroupType.NAME), request);
assertEquals(Status.FORBIDDEN.getStatusCode(), response.getStatus());
}
use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.
the class RResourceIT method updateHosted.
@Test
public void updateHosted() throws Exception {
repos.createRHosted(HOSTED_NAME);
AbstractRepositoryApiRequest request = createHostedRequest(false);
Response response = put(getUpdateRepositoryPathUrl(HostedType.NAME, HOSTED_NAME), request);
assertEquals(Status.NO_CONTENT.getStatusCode(), response.getStatus());
Repository repository = repositoryManager.get(request.getName());
assertNotNull(repository);
assertThat(repository.getConfiguration().attributes("storage").get("strictContentTypeValidation"), is(false));
repositoryManager.delete(HOSTED_NAME);
}
use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.
the class RResourceIT method updateProxy_noAuthz.
@Test
public void updateProxy_noAuthz() throws Exception {
repos.createRProxy(PROXY_NAME, REMOTE_URL);
setUnauthorizedUser();
AbstractRepositoryApiRequest request = createProxyRequest(false);
Response response = put(getUpdateRepositoryPathUrl(ProxyType.NAME, PROXY_NAME), request);
assertEquals(Status.FORBIDDEN.getStatusCode(), response.getStatus());
}
Aggregations