use of com.sequenceiq.freeipa.entity.Stack in project cloudbreak by hortonworks.
the class StackServiceTest method getByEnvironmentCrn.
@Test
void getByEnvironmentCrn() {
when(stackRepository.findByEnvironmentCrnAndAccountId(ENVIRONMENT_CRN, ACCOUNT_ID)).thenReturn(Optional.of(stack));
Stack stackByEnvironmentCrn = underTest.getByEnvironmentCrnAndAccountId(ENVIRONMENT_CRN, ACCOUNT_ID);
assertEquals(stack, stackByEnvironmentCrn);
}
use of com.sequenceiq.freeipa.entity.Stack in project cloudbreak by hortonworks.
the class StackServiceTest method setUp.
@BeforeEach
void setUp() {
stack = new Stack();
stack.setId(STACK_ID);
stack.setName(STACK_NAME);
underTest.nowSupplier = () -> MOCK_NOW;
}
use of com.sequenceiq.freeipa.entity.Stack in project cloudbreak by hortonworks.
the class StackServiceTest method save.
@Test
void save() {
when(stackRepository.save(stack)).thenReturn(stack);
Stack savedStack = underTest.save(stack);
assertEquals(stack, savedStack);
}
use of com.sequenceiq.freeipa.entity.Stack in project cloudbreak by hortonworks.
the class StackServiceTest method getStackById.
@Test
void getStackById() {
when(stackRepository.findById(STACK_ID)).thenReturn(Optional.of(stack));
Stack stackById = underTest.getStackById(STACK_ID);
assertEquals(stack, stackById);
}
use of com.sequenceiq.freeipa.entity.Stack in project cloudbreak by hortonworks.
the class StackServiceTest method getByEnvironmentCrnAndAccountIdWithListsShouldReturnByChildEnvironmentCrn.
@Test
void getByEnvironmentCrnAndAccountIdWithListsShouldReturnByChildEnvironmentCrn() {
when(stackRepository.findByEnvironmentCrnAndAccountIdWithList(ENVIRONMENT_CRN, ACCOUNT_ID)).thenReturn(Optional.empty());
when(stackRepository.findByChildEnvironmentCrnAndAccountIdWithList(ENVIRONMENT_CRN, ACCOUNT_ID)).thenReturn(Optional.of(stack));
Stack result = underTest.getByEnvironmentCrnAndAccountIdWithLists(ENVIRONMENT_CRN, ACCOUNT_ID);
verify(stackRepository).findByEnvironmentCrnAndAccountIdWithList(ENVIRONMENT_CRN, ACCOUNT_ID);
verify(stackRepository).findByChildEnvironmentCrnAndAccountIdWithList(ENVIRONMENT_CRN, ACCOUNT_ID);
assertEquals(stack, result);
}
Aggregations