use of org.sonatype.nexus.repository.view.Content in project nexus-repository-r by sonatype-nexus-community.
the class RFacetUtilsTest method content.
@Test
public void content() throws Exception {
Content content = toContent(asset, blob);
assertThat(content.getAttributes().get("lastModified"), is(notNullValue()));
}
use of org.sonatype.nexus.repository.view.Content in project nexus-repository-r by sonatype-nexus-community.
the class RHostedFacetImplTest method getPackagesReturnsCorrectContentType.
@Test
public void getPackagesReturnsCorrectContentType() throws Exception {
Content packages = underTest.getPackages(PACKAGE_PATH);
assertThat(packages.getContentType(), is(equalTo("application/x-gzip")));
}
use of org.sonatype.nexus.repository.view.Content in project nexus-repository-r by sonatype-nexus-community.
the class RHostedFacetImplTest method getArchive.
@Test
public void getArchive() throws Exception {
Content archive = underTest.getArchive(PACKAGE_PATH);
assertThat(archive, is(notNullValue()));
}
use of org.sonatype.nexus.repository.view.Content in project nexus-repository-r by sonatype-nexus-community.
the class RFacetUtils method toContent.
/**
* Convert an asset blob to {@link Content}.
*
* @return content of asset blob
*/
static Content toContent(final Asset asset, final Blob blob) {
Content content = new Content(new BlobPayload(blob, asset.requireContentType()));
Content.extractFromAsset(asset, HASH_ALGORITHMS, content.getAttributes());
return content;
}
use of org.sonatype.nexus.repository.view.Content in project nexus-repository-r by sonatype-nexus-community.
the class RHostedFacetImplTest method getContentReturnsCorrectContentType.
@Test
public void getContentReturnsCorrectContentType() throws Exception {
when(asset.requireContentType()).thenReturn("application/x-gzip");
Content packages = underTest.getStoredContent(PACKAGE_PATH);
assertThat(packages.getContentType(), is(equalTo("application/x-gzip")));
}
Aggregations