Search in sources :

Example 6 with AbstractRepositoryApiRequest

use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.

the class RResourceIT method updateHosted_noAuthz.

@Test
public void updateHosted_noAuthz() throws Exception {
    repos.createRHosted(HOSTED_NAME);
    setUnauthorizedUser();
    AbstractRepositoryApiRequest request = createHostedRequest(false);
    Response response = put(getUpdateRepositoryPathUrl(HostedType.NAME, HOSTED_NAME), request);
    assertEquals(Status.FORBIDDEN.getStatusCode(), response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) AbstractRepositoryApiRequest(org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest) Test(org.junit.Test)

Example 7 with AbstractRepositoryApiRequest

use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.

the class RResourceIT method createProxy_noAuthz.

@Test
public void createProxy_noAuthz() throws Exception {
    setUnauthorizedUser();
    AbstractRepositoryApiRequest request = createProxyRequest(true);
    Response response = post(getCreateRepositoryPathUrl(ProxyType.NAME), request);
    assertEquals(Status.FORBIDDEN.getStatusCode(), response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) AbstractRepositoryApiRequest(org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest) Test(org.junit.Test)

Example 8 with AbstractRepositoryApiRequest

use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.

the class RResourceIT method createGroup.

@Test
public void createGroup() throws Exception {
    AbstractRepositoryApiRequest request = createGroupRequest(true);
    Response response = post(getCreateRepositoryPathUrl(GroupType.NAME), request);
    assertEquals(Status.CREATED.getStatusCode(), response.getStatus());
    repositoryManager.delete(request.getName());
}
Also used : Response(javax.ws.rs.core.Response) AbstractRepositoryApiRequest(org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest) Test(org.junit.Test)

Example 9 with AbstractRepositoryApiRequest

use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.

the class RResourceIT method createProxy_noAuthc.

@Test
public void createProxy_noAuthc() throws Exception {
    setBadCredentials();
    AbstractRepositoryApiRequest request = createProxyRequest(true);
    Response response = post(getCreateRepositoryPathUrl(ProxyType.NAME), request);
    assertEquals(Status.UNAUTHORIZED.getStatusCode(), response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) AbstractRepositoryApiRequest(org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest) Test(org.junit.Test)

Example 10 with AbstractRepositoryApiRequest

use of org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest in project nexus-repository-r by sonatype-nexus-community.

the class RResourceIT method createHosted_noAuthz.

@Test
public void createHosted_noAuthz() throws Exception {
    setUnauthorizedUser();
    AbstractRepositoryApiRequest request = createHostedRequest(true);
    Response response = post(getCreateRepositoryPathUrl(HostedType.NAME), request);
    assertEquals(Status.FORBIDDEN.getStatusCode(), response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) AbstractRepositoryApiRequest(org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest) Test(org.junit.Test)

Aggregations

Response (javax.ws.rs.core.Response)15 Test (org.junit.Test)15 AbstractRepositoryApiRequest (org.sonatype.nexus.repository.rest.api.model.AbstractRepositoryApiRequest)15 Repository (org.sonatype.nexus.repository.Repository)4