BlobPullerIntegrationTest.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:minikube-build-tools-for-java 作者:
@Test
public void testPull_unknownBlob() throws RegistryException, IOException, DigestException {
  DescriptorDigest nonexistentDigest =
      DescriptorDigest.fromHash(
          "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

  try {
    RegistryClient registryClient = new RegistryClient(null, "localhost:5000", "busybox");
    registryClient.pullBlob(nonexistentDigest, Mockito.mock(Path.class));
    Assert.fail("Trying to pull nonexistent blob should have errored");

  } catch (RegistryErrorException ex) {
    Assert.assertThat(
        ex.getMessage(),
        CoreMatchers.containsString(
            "pull BLOB for localhost:5000/busybox with digest " + nonexistentDigest));
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号