Search in sources :

Example 1 with StackPatchStatus

use of com.sequenceiq.cloudbreak.domain.stack.StackPatchStatus in project cloudbreak by hortonworks.

the class StackPatchServiceTest method updateStatusWithoutReason.

@Test
void updateStatusWithoutReason() {
    StackPatch stackPatch = new StackPatch();
    StackPatchStatus status = StackPatchStatus.SCHEDULED;
    StackPatch result = underTest.updateStatus(stackPatch, status);
    assertThat(result).returns(status, StackPatch::getStatus).returns("", StackPatch::getStatusReason);
    verify(stackPatchRepository).save(stackPatch);
}
Also used : StackPatch(com.sequenceiq.cloudbreak.domain.stack.StackPatch) StackPatchStatus(com.sequenceiq.cloudbreak.domain.stack.StackPatchStatus) Test(org.junit.jupiter.api.Test)

Example 2 with StackPatchStatus

use of com.sequenceiq.cloudbreak.domain.stack.StackPatchStatus in project cloudbreak by hortonworks.

the class StackPatchServiceTest method updateStatusWithReason.

@Test
void updateStatusWithReason() {
    StackPatch stackPatch = new StackPatch();
    String reason = "reason";
    StackPatchStatus status = StackPatchStatus.SCHEDULED;
    StackPatch result = underTest.updateStatusAndReportUsage(stackPatch, status, reason);
    assertThat(result).returns(status, StackPatch::getStatus).returns(reason, StackPatch::getStatusReason);
    verify(stackPatchRepository).save(stackPatch);
    verify(stackPatchUsageReporterService).reportUsage(stackPatch);
}
Also used : StackPatch(com.sequenceiq.cloudbreak.domain.stack.StackPatch) StackPatchStatus(com.sequenceiq.cloudbreak.domain.stack.StackPatchStatus) Test(org.junit.jupiter.api.Test)

Aggregations

StackPatch (com.sequenceiq.cloudbreak.domain.stack.StackPatch)2 StackPatchStatus (com.sequenceiq.cloudbreak.domain.stack.StackPatchStatus)2 Test (org.junit.jupiter.api.Test)2