Search in sources :

Example 1 with VariableSource

use of org.sonatype.nexus.selector.VariableSource in project nexus-repository-r by sonatype-nexus-community.

the class RUploadHandlerTest method testHandle.

@Test
public void testHandle() throws IOException {
    ComponentUpload component = createComponentUpload(PACKAGE_PATH, PACKAGE_NAME);
    UploadResponse uploadResponse = underTest.handle(repository, component);
    assertThat(uploadResponse.getAssetPaths(), contains(PACKAGE_PATH_FULL));
    assertThat(uploadResponse.getComponentId().getValue(), is(NU_ID));
    verify(contentPermissionChecker).isPermitted(eq(REPO_NAME), eq(RFormat.NAME), eq(BreadActions.EDIT), captor.capture());
    VariableSource source = captor.getValue();
    assertThat(source.get("format"), is(Optional.of(RFormat.NAME)));
    assertThat(source.get("path"), is(Optional.of(PACKAGE_PATH_FULL)));
}
Also used : ComponentUpload(org.sonatype.nexus.repository.upload.ComponentUpload) UploadResponse(org.sonatype.nexus.repository.upload.UploadResponse) VariableSource(org.sonatype.nexus.selector.VariableSource) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ComponentUpload (org.sonatype.nexus.repository.upload.ComponentUpload)1 UploadResponse (org.sonatype.nexus.repository.upload.UploadResponse)1 VariableSource (org.sonatype.nexus.selector.VariableSource)1