AptRestoreBlobStrategy extends BaseRestoreBlobStrategy<AptRestoreBlobData> { @Override protected boolean componentRequired(final AptRestoreBlobData data) { final Repository repository = data.getBlobData().getRepository(); final AptRestoreFacet facet = repository.facet(AptRestoreFacet.class); return facet.componentRequired(data.getBlobData().getBlobName()); } @Inject  AptRestoreBlobStrategy(final NodeAccess nodeAccess,
                                final RepositoryManager repositoryManager,
                                final BlobStoreManager blobStoreManager,
                                final DryRunPrefix dryRunPrefix);   }
@Test public void testComponentIsRequiredForDeb() { boolean expected = true; when(aptRestoreFacet.componentRequired(PACKAGE_PATH)).thenReturn(expected); assertThat(underTest.componentRequired(aptRestoreBlobData), is(expected)); verify(aptRestoreFacet).componentRequired(PACKAGE_PATH); verifyNoMoreInteractions(aptRestoreFacet); }
@Test public void testComponentIsNotRequiredForRelease() { boolean expected = false; when(aptRestoreFacet.componentRequired(RELEASE_FILE_PATH)).thenReturn(expected); assertThat(underTest.componentRequired(aptRestoreBlobData), is(expected)); verify(aptRestoreFacet).componentRequired(PACKAGE_PATH); verifyNoMoreInteractions(aptRestoreFacet); }