### Question:
ComposerJsonProcessor { public Content generatePackagesFromList(final Repository repository, final Payload payload) throws IOException { Map<String, Object> listJson = parseJson(payload); return buildPackagesJson(repository, new LinkedHashSet<>((Collection<String>) listJson.get(PACKAGE_NAMES_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 generatePackagesFromList() throws Exception { String listJson = readStreamToString(getClass().getResourceAsStream("generatePackagesFromList.list.json")); String packagesJson = readStreamToString(getClass().getResourceAsStream("generatePackagesFromList.packages.json")); when(repository.getUrl()).thenReturn("http: when(payload1.openInputStream()).thenReturn(new ByteArrayInputStream(listJson.getBytes(UTF_8))); ComposerJsonProcessor underTest = new ComposerJsonProcessor(composerJsonExtractor); Content output = underTest.generatePackagesFromList(repository, payload1); assertEquals(packagesJson, readStreamToString(output.openInputStream()), true); }