### Question:
ComposerHostedFacetImpl extends FacetSupport implements ComposerHostedFacet { @Override @TransactionalTouchMetadata public Content getPackagesJson() throws IOException { StorageTx tx = UnitOfWork.currentTx(); return composerJsonProcessor .generatePackagesFromComponents(getRepository(), tx.browseComponents(tx.findBucket(getRepository()))); } @Inject  ComposerHostedFacetImpl(final ComposerJsonProcessor composerJsonProcessor); @Override @TransactionalStoreBlob void upload(final String vendor, final String project, final String version, final Payload payload); @Override Content getZipball(final String path); @Override @TransactionalTouchMetadata Content getPackagesJson(); @Override @TransactionalTouchMetadata Content getProviderJson(final String vendor, final String project); @Override @TransactionalStoreBlob void rebuildProviderJson(final String vendor, final String project);  }### Answer:
@Test public void testGetPackagesJson() throws Exception { when(tx.browseComponents(bucket)).thenReturn(components); when(composerJsonProcessor.generatePackagesFromComponents(repository, components)).thenReturn(content); assertThat(underTest.getPackagesJson(), is(content)); }