use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.
the class RResourceIT method updateProxy.
@Test
public void updateProxy() throws Exception {
repos.createRProxy(PROXY_NAME, REMOTE_URL);
AbstractRepositoryApiRequest request = createProxyRequest(false);
Response response = put(getUpdateRepositoryPathUrl(ProxyType.NAME, PROXY_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(PROXY_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_noAuthc.
@Test
public void updateProxy_noAuthc() throws Exception {
setBadCredentials();
AbstractRepositoryApiRequest request = createProxyRequest(false);
Response response = put(getUpdateRepositoryPathUrl(ProxyType.NAME, PROXY_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 createHosted.
@Test
public void createHosted() throws Exception {
AbstractRepositoryApiRequest request = createHostedRequest(true);
Response response = post(getCreateRepositoryPathUrl(HostedType.NAME), request);
assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
Repository repository = repositoryManager.get(request.getName());
assertNotNull(repository);
assertEquals(RFormat.NAME, repository.getFormat().getValue());
assertEquals(HostedType.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_noAuthc.
@Test
public void createGroup_noAuthc() throws Exception {
setBadCredentials();
AbstractRepositoryApiRequest request = createGroupRequest(true);
Response response = post(getCreateRepositoryPathUrl(GroupType.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 createHosted_noAuthc.
@Test
public void createHosted_noAuthc() throws Exception {
setBadCredentials();
AbstractRepositoryApiRequest request = createHostedRequest(true);
Response response = post(getCreateRepositoryPathUrl(HostedType.NAME), request);
assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
}
Aggregations