use of org.hamcrest.core.IsAnything in project artipie by artipie.
the class NpmITCase method npmPublish.
@Test
void npmPublish() throws Exception {
final String tgz = String.format("%s/-/%s-1.0.1.tgz", NpmITCase.PROJ, NpmITCase.PROJ);
this.containers.putBinaryToClient(new TestResource("npm/simple-npm-project/index.js").asBytes(), String.format("/w/%s/index.js", NpmITCase.PROJ));
this.containers.putBinaryToClient(new TestResource("npm/simple-npm-project/package.json").asBytes(), String.format("/w/%s/package.json", NpmITCase.PROJ));
this.containers.assertExec("Package was published", new ContainerResultMatcher(new IsEqual<>(0), new StringContains(NpmITCase.ADDED_PROJ)), "npm", "publish", NpmITCase.PROJ, "--registry", NpmITCase.REPO);
this.containers.assertArtipieContent("Meta json is incorrect", String.format("/var/artipie/data/my-npm/%s/meta.json", NpmITCase.PROJ), new MatcherOf<>(bytes -> {
return Json.createReader(new ByteArrayInputStream(bytes)).readObject().getJsonObject("versions").getJsonObject("1.0.1").getJsonObject("dist").getString("tarball").equals(String.format("/%s", tgz));
}));
this.containers.assertArtipieContent("Tarball should be added to storage", String.format("/var/artipie/data/my-npm/%s", tgz), new IsAnything<>());
}
Aggregations