Package org.sonatype.nexus.component.model

Examples of org.sonatype.nexus.component.model.Asset.openStream()


    assertThat(encode(injectHasher("SHA512").hash(mockAsset())), is(equalTo(SHA512_HASH)));
  }

  private static Asset mockAsset() throws Exception {
    Asset asset = mock(Asset.class);
    when(asset.openStream()).thenReturn(new ByteArrayInputStream(DATA.getBytes(Charsets.UTF_8)));
    return asset;
  }

  private static String encode(byte[] hash) {
    return BaseEncoding.base16().encode(hash).toLowerCase(Locale.ENGLISH);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.