use of org.codice.ddf.migration.util.MigratableUtil in project ddf by codice.
the class PlatformMigratableTest method testExportExceptionThrownWhenCopyingFileFromSystemPropertyValue.
@Test(expected = MigrationException.class)
public void testExportExceptionThrownWhenCopyingFileFromSystemPropertyValue() throws Exception {
// Setup
MigratableUtil mockMigratableUtil = mock(MigratableUtil.class);
doThrow(MigrationException.class).when(mockMigratableUtil).copyFileFromSystemPropertyValue(any(String.class), eq(exportDirectory), Matchers.<Collection<MigrationWarning>>any());
PlatformMigratable platformMigratable = new PlatformMigratable(DESCRIBABLE_BEAN, mockMigratableUtil);
// Perform test
platformMigratable.export(exportDirectory);
}
use of org.codice.ddf.migration.util.MigratableUtil in project ddf by codice.
the class PlatformMigratableTest method testExportValidRelativePaths.
@Test
public void testExportValidRelativePaths() throws Exception {
// Setup
MigratableUtil mockMigratableUtil = mock(MigratableUtil.class);
PlatformMigratable platformMigratable = new PlatformMigratable(DESCRIBABLE_BEAN, mockMigratableUtil);
// Perform Test
platformMigratable.export(exportDirectory);
// Verify
assertWsSecurityExport(mockMigratableUtil);
assertSystemPropertiesFilesExport(mockMigratableUtil);
assertKeystoresExport(mockMigratableUtil);
assertAppListExported(mockMigratableUtil);
}
use of org.codice.ddf.migration.util.MigratableUtil in project ddf by codice.
the class SecurityMigratableTest method testExportExceptionThrownWhenCopyingDirectory.
@Test(expected = MigrationException.class)
public void testExportExceptionThrownWhenCopyingDirectory() throws Exception {
MigratableUtil mockMigratableUtil = mock(MigratableUtil.class);
doThrow(MigrationException.class).when(mockMigratableUtil).copyDirectory(any(Path.class), eq(EXPORT_DIRECTORY), Matchers.<Collection<MigrationWarning>>any());
SecurityMigratable securityMigratable = new SecurityMigratable(DESCRIBABLE_BEAN, mockMigratableUtil);
securityMigratable.export(EXPORT_DIRECTORY);
}
use of org.codice.ddf.migration.util.MigratableUtil in project ddf by codice.
the class SecurityMigratableTest method testExportValidRelativePaths.
@Test
public void testExportValidRelativePaths() throws Exception {
// Setup
MigratableUtil mockMigratableUtil = mock(MigratableUtil.class);
when(mockMigratableUtil.getJavaPropertyValue(SERVER_ENCRYPTION_PROPERTIES_PATH, CRL_PROP_KEY)).thenReturn(EXPECTED_SERVER_ENCRYPTION_CRL_PATH.toString());
when(mockMigratableUtil.getJavaPropertyValue(SERVER_SIGNATURE_PROPERTIES_PATH, CRL_PROP_KEY)).thenReturn(EXPECTED_SERVER_SIGNATURE_CRL_PATH.toString());
when(mockMigratableUtil.getJavaPropertyValue(ISSUER_ENCRYPTION_PROPERTIES_PATH, CRL_PROP_KEY)).thenReturn(EXPECTED_ISSUER_ENCRYPTION_CRL_PATH.toString());
when(mockMigratableUtil.getJavaPropertyValue(ISSUER_SIGNATURE_PROPERTIES_PATH, CRL_PROP_KEY)).thenReturn(EXPECTED_ISSUER_SIGNATURE_CRL_PATH.toString());
SecurityMigratable securityMigratable = new SecurityMigratable(DESCRIBABLE_BEAN, mockMigratableUtil);
// Perform Test
securityMigratable.export(EXPORT_DIRECTORY);
// Verify
assertCrlExport(mockMigratableUtil);
assertPdpDirectoryExport(mockMigratableUtil);
}
use of org.codice.ddf.migration.util.MigratableUtil in project ddf by codice.
the class SecurityMigratableTest method testExportExceptionThrownWhenReadingCrlPropsFile.
@Test(expected = MigrationException.class)
public void testExportExceptionThrownWhenReadingCrlPropsFile() {
// Setup
MigratableUtil mockMigratableUtil = mock(MigratableUtil.class);
doThrow(MigrationException.class).when(mockMigratableUtil).getJavaPropertyValue(SERVER_ENCRYPTION_PROPERTIES_PATH, CRL_PROP_KEY);
SecurityMigratable securityMigratable = new SecurityMigratable(DESCRIBABLE_BEAN, mockMigratableUtil);
// Perform test
securityMigratable.export(EXPORT_DIRECTORY);
}
Aggregations