Search in sources :

Example 1 with SimpleVariableResolverAdapter

use of org.sonatype.nexus.repository.security.internal.SimpleVariableResolverAdapter in project nexus-repository-r by sonatype-nexus-community.

the class RUploadHandlerTest method setup.

@Before
public void setup() throws IOException {
    when(contentPermissionChecker.isPermitted(eq(REPO_NAME), eq(RFormat.NAME), eq(BreadActions.EDIT), any())).thenReturn(true);
    underTest = new RUploadHandler(new SimpleVariableResolverAdapter(), contentPermissionChecker, emptySet());
    when(repository.getName()).thenReturn(REPO_NAME);
    when(storageFacet.txSupplier()).thenReturn(() -> storageTx);
    when(repository.facet(StorageFacet.class)).thenReturn(storageFacet);
    when(repository.facet(RHostedFacet.class)).thenReturn(rHostedFacet);
    Asset asset = mockAsset(PACKAGE_PATH_FULL);
    when(rHostedFacet.upload(PACKAGE_PATH_FULL, payload)).thenReturn(asset);
}
Also used : Asset(org.sonatype.nexus.repository.storage.Asset) SimpleVariableResolverAdapter(org.sonatype.nexus.repository.security.internal.SimpleVariableResolverAdapter) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 SimpleVariableResolverAdapter (org.sonatype.nexus.repository.security.internal.SimpleVariableResolverAdapter)1 Asset (org.sonatype.nexus.repository.storage.Asset)1