Search in sources :

Example 1 with DiskEncryptionSetCreationCheckerContext

use of com.sequenceiq.cloudbreak.cloud.azure.task.diskencryptionset.DiskEncryptionSetCreationCheckerContext in project cloudbreak by hortonworks.

the class AzurePollTaskFactoryIntegrationTest method diskEncryptionSetCreationCheckerTaskTest.

@Test
void diskEncryptionSetCreationCheckerTaskTest() {
    when(authenticatedContext.getParameter(AzureClient.class)).thenReturn(azureClient);
    DiskEncryptionSetCreationCheckerContext checkerContext = new DiskEncryptionSetCreationCheckerContext(RESOURCE_GROUP_NAME, DISK_ENCRYPTION_SET_NAME);
    PollTask<DiskEncryptionSetInner> result = underTest.diskEncryptionSetCreationCheckerTask(authenticatedContext, checkerContext);
    assertThat(result).isInstanceOf(DiskEncryptionSetCreationCheckerTask.class);
    DiskEncryptionSetCreationCheckerTask checkerTask = (DiskEncryptionSetCreationCheckerTask) result;
    assertThat(checkerTask.getAuthenticatedContext()).isSameAs(authenticatedContext);
}
Also used : DiskEncryptionSetCreationCheckerTask(com.sequenceiq.cloudbreak.cloud.azure.task.diskencryptionset.DiskEncryptionSetCreationCheckerTask) DiskEncryptionSetCreationCheckerContext(com.sequenceiq.cloudbreak.cloud.azure.task.diskencryptionset.DiskEncryptionSetCreationCheckerContext) DiskEncryptionSetInner(com.microsoft.azure.management.compute.implementation.DiskEncryptionSetInner) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with DiskEncryptionSetCreationCheckerContext

use of com.sequenceiq.cloudbreak.cloud.azure.task.diskencryptionset.DiskEncryptionSetCreationCheckerContext in project cloudbreak by hortonworks.

the class AzurePollTaskFactoryTest method diskEncryptionSetCreationCheckerTaskTest.

@Test
void diskEncryptionSetCreationCheckerTaskTest() {
    DiskEncryptionSetCreationCheckerContext checkerContext = new DiskEncryptionSetCreationCheckerContext(RESOURCE_GROUP_NAME, DISK_ENCRYPTION_SET_NAME);
    PollTask<DiskEncryptionSetInner> checkerTask = mock(PollTask.class);
    when(applicationContext.getBean(DiskEncryptionSetCreationCheckerTask.NAME, authenticatedContext, checkerContext)).thenReturn(checkerTask);
    PollTask<DiskEncryptionSetInner> result = underTest.diskEncryptionSetCreationCheckerTask(authenticatedContext, checkerContext);
    assertThat(result).isSameAs(checkerTask);
}
Also used : DiskEncryptionSetCreationCheckerContext(com.sequenceiq.cloudbreak.cloud.azure.task.diskencryptionset.DiskEncryptionSetCreationCheckerContext) DiskEncryptionSetInner(com.microsoft.azure.management.compute.implementation.DiskEncryptionSetInner) Test(org.junit.jupiter.api.Test)

Example 3 with DiskEncryptionSetCreationCheckerContext

use of com.sequenceiq.cloudbreak.cloud.azure.task.diskencryptionset.DiskEncryptionSetCreationCheckerContext in project cloudbreak by hortonworks.

the class AzureEncryptionResources method pollDiskEncryptionSetCreation.

private DiskEncryptionSetInner pollDiskEncryptionSetCreation(AuthenticatedContext authenticatedContext, String desResourceGroupName, String desName, DiskEncryptionSetInner desInitial) {
    LOGGER.info("Initializing poller for the creation of Disk Encryption Set \"{}\" in Resource Group \"{}\".", desName, desResourceGroupName);
    DiskEncryptionSetCreationCheckerContext checkerContext = new DiskEncryptionSetCreationCheckerContext(desResourceGroupName, desName);
    return diskEncryptionSetCreationPoller.startPolling(authenticatedContext, checkerContext, desInitial);
}
Also used : DiskEncryptionSetCreationCheckerContext(com.sequenceiq.cloudbreak.cloud.azure.task.diskencryptionset.DiskEncryptionSetCreationCheckerContext)

Aggregations

DiskEncryptionSetCreationCheckerContext (com.sequenceiq.cloudbreak.cloud.azure.task.diskencryptionset.DiskEncryptionSetCreationCheckerContext)3 DiskEncryptionSetInner (com.microsoft.azure.management.compute.implementation.DiskEncryptionSetInner)2 Test (org.junit.jupiter.api.Test)2 DiskEncryptionSetCreationCheckerTask (com.sequenceiq.cloudbreak.cloud.azure.task.diskencryptionset.DiskEncryptionSetCreationCheckerTask)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1