Search in sources :

Example 1 with NestedAttributesMap

use of org.sonatype.nexus.common.collect.NestedAttributesMap in project nexus-repository-r by sonatype-nexus-community.

the class RPackagesBuilderTest method createAsset.

private Asset createAsset(final String assetName, final String packageName, final String packageVersion) {
    NestedAttributesMap formatAttributes = mock(NestedAttributesMap.class);
    when(formatAttributes.get(P_PACKAGE, String.class)).thenReturn(packageName);
    when(formatAttributes.get(P_VERSION, String.class)).thenReturn(packageVersion);
    when(formatAttributes.get(P_DEPENDS, String.class)).thenReturn("Depends:" + assetName);
    when(formatAttributes.get(P_IMPORTS, String.class)).thenReturn("Imports:" + assetName);
    when(formatAttributes.get(P_SUGGESTS, String.class)).thenReturn("Suggests:" + assetName);
    when(formatAttributes.get(P_LICENSE, String.class)).thenReturn("License:" + assetName);
    when(formatAttributes.get(P_NEEDS_COMPILATION, String.class)).thenReturn("NeedsCompilation:" + assetName);
    Asset asset = mock(Asset.class);
    when(asset.formatAttributes()).thenReturn(formatAttributes);
    when(asset.name()).thenReturn(assetName);
    return asset;
}
Also used : Asset(org.sonatype.nexus.repository.storage.Asset) NestedAttributesMap(org.sonatype.nexus.common.collect.NestedAttributesMap)

Example 2 with NestedAttributesMap

use of org.sonatype.nexus.common.collect.NestedAttributesMap in project nexus-repository-r by sonatype-nexus-community.

the class RPackagesBuilderTest method createAsset.

private Asset createAsset(final String assetName, final String packageName, final String packageVersion) {
    NestedAttributesMap formatAttributes = mock(NestedAttributesMap.class);
    when(formatAttributes.get(P_PACKAGE, String.class)).thenReturn(packageName);
    when(formatAttributes.get(P_VERSION, String.class)).thenReturn(packageVersion);
    when(formatAttributes.get(P_DEPENDS, String.class)).thenReturn("Depends:" + assetName);
    when(formatAttributes.get(P_IMPORTS, String.class)).thenReturn("Imports:" + assetName);
    when(formatAttributes.get(P_SUGGESTS, String.class)).thenReturn("Suggests:" + assetName);
    when(formatAttributes.get(P_LINKINGTO, String.class)).thenReturn("LinkingTo:" + assetName);
    when(formatAttributes.get(P_LICENSE, String.class)).thenReturn("License:" + assetName);
    when(formatAttributes.get(P_NEEDS_COMPILATION, String.class)).thenReturn("NeedsCompilation:" + assetName);
    Asset asset = mock(Asset.class);
    when(asset.formatAttributes()).thenReturn(formatAttributes);
    when(asset.name()).thenReturn(assetName);
    return asset;
}
Also used : Asset(org.sonatype.nexus.repository.storage.Asset) NestedAttributesMap(org.sonatype.nexus.common.collect.NestedAttributesMap)

Aggregations

NestedAttributesMap (org.sonatype.nexus.common.collect.NestedAttributesMap)2 Asset (org.sonatype.nexus.repository.storage.Asset)2