### Question:
ComposerProxyFacetImpl extends ProxyFacetSupport { @Nullable @Override protected Content getCachedContent(final Context context) throws IOException { AssetKind assetKind = context.getAttributes().require(AssetKind.class); switch (assetKind) { case PACKAGES: return content().get(PACKAGES_JSON); case LIST: return content().get(LIST_JSON); case PROVIDER: return content().get(buildProviderPath(context)); case ZIPBALL: return content().get(buildZipballPath(context)); default: throw new IllegalStateException(); } } @Inject  ComposerProxyFacetImpl(final ComposerJsonProcessor composerJsonProcessor);   }### Answer:
@Test public void getCachedContentPackages() throws Exception { when(contextAttributes.require(AssetKind.class)).thenReturn(PACKAGES); when(composerContentFacet.get(PACKAGES_PATH)).thenReturn(content); assertThat(underTest.getCachedContent(context), is(content)); }
@Test public void getCachedContentList() throws Exception { when(contextAttributes.require(AssetKind.class)).thenReturn(LIST); when(composerContentFacet.get(LIST_PATH)).thenReturn(content); assertThat(underTest.getCachedContent(context), is(content)); }
@Test public void getCachedContentProvider() throws Exception { when(contextAttributes.require(AssetKind.class)).thenReturn(PROVIDER); when(contextAttributes.require(TokenMatcher.State.class)).thenReturn(state); when(composerContentFacet.get(PROVIDER_PATH)).thenReturn(content); when(state.getTokens()).thenReturn(new ImmutableMap.Builder<String, String>() .put("vendor", "vendor") .put("project", "project") .build()); assertThat(underTest.getCachedContent(context), is(content)); }
@Test public void getCachedContentZipball() throws Exception { when(contextAttributes.require(AssetKind.class)).thenReturn(ZIPBALL); when(contextAttributes.require(TokenMatcher.State.class)).thenReturn(state); when(composerContentFacet.get(ZIPBALL_PATH)).thenReturn(content); when(state.getTokens()).thenReturn(new ImmutableMap.Builder<String, String>() .put("vendor", "vendor") .put("project", "project") .put("version", "version") .put("name", "project-version") .build()); assertThat(underTest.getCachedContent(context), is(content)); }