### Question:
ComposerJsonProcessor { public String getDistUrl(final String vendor, final String project, final String version, final Payload payload) throws IOException { String vendorAndProject = String.format(VENDOR_AND_PROJECT, vendor, project); Map<String, Object> json = parseJson(payload); Map<String, Object> packagesMap = (Map<String, Object>) json.get(PACKAGES_KEY); Map<String, Object> packageInfo = (Map<String, Object>) packagesMap.get(vendorAndProject); Map<String, Object> versionInfo = (Map<String, Object>) packageInfo.get(version); Map<String, Object> distInfo = (Map<String, Object>) versionInfo.get(DIST_KEY); return (String) distInfo.get(URL_KEY); } @Inject  ComposerJsonProcessor(final ComposerJsonExtractor composerJsonExtractor); Content generatePackagesFromList(final Repository repository, final Payload payload); Content generatePackagesFromComponents(final Repository repository, final Iterable<Component> components); Payload rewriteProviderJson(final Repository repository, final Payload payload); Content buildProviderJson(final Repository repository,
                                   final StorageTx storageTx,
                                   final Iterable<Component> components); Content mergePackagesJson(final Repository repository, final List<Payload> payloads); Content mergeProviderJson(final Repository repository, final List<Payload> payloads, final DateTime now); String getDistUrl(final String vendor, final String project, final String version, final Payload payload);  }### Answer:
@Test public void getDistUrl() throws Exception { String inputJson = readStreamToString(getClass().getResourceAsStream("getDistUrl.json")); when(payload1.openInputStream()).thenReturn(new ByteArrayInputStream(inputJson.getBytes(UTF_8))); ComposerJsonProcessor underTest = new ComposerJsonProcessor(composerJsonExtractor); String distUrl = underTest.getDistUrl("vendor1", "project1", "2.0.0", payload1); assertThat(distUrl, is("https: }