@Test public void testReadProductReleaseBuildIds() throws Exception { String relativeUrl = "/product-releases/" + productReleaseId + "/distributed-build-records-ids"; stubFor( get(urlEqualTo(CONTEXT_URL + relativeUrl)) .willReturn( aResponse() .withHeader("Content-Type", "application/json") .withBody( readResponseBodyFromTemplate( "product-release-distributed-build-records-ids-1.json")))); Collection<Integer> ids = pncClient.findBuildIdsOfProductRelease(productReleaseId); assertArrayEquals(asList(1, 2).toArray(), ids.toArray()); }
@Test public void testReadBuildArtifacts() throws Exception { Integer buildId = 61; String relativeUrl = "/build-records/" + buildId + "/artifacts?pageIndex=0&pageSize=" + PncClient.MAX_ARTIFACTS + "&sort=&q="; stubFor( get(urlEqualTo(CONTEXT_URL + relativeUrl)) .willReturn( aResponse() .withHeader("Content-Type", "application/json") .withBody(readResponseBodyFromTemplate("build-records-61-artifacts-1.json")))); PncBuild pncBuild = pncClient.findBuild(buildId); assertEquals(3, pncBuild.buildArtifacts.size()); assertEquals(1, pncBuild.dependencies.size()); // FIXME nvr, build environment, actual files }