use of com.sequenceiq.freeipa.service.freeipa.cleanup.FreeIpaServerDeletionPollerObject in project cloudbreak by hortonworks.
the class FreeIplaServiceDeletionListenerTaskTest method testCheckStatusFalse.
@Test
void testCheckStatusFalse() throws Exception {
FreeIpaServerDeletionPollerObject pollerObject = new FreeIpaServerDeletionPollerObject(1L, Set.of("example1.com"));
FreeIpaClient client = mock(FreeIpaClient.class);
TopologySuffix suffix = new TopologySuffix();
suffix.setCn("ca");
TopologySegment segment = new TopologySegment();
segment.setRightNode("example1.com");
segment.setLeftNode("example2.com");
when(freeIpaClientFactory.getFreeIpaClientForStackId(anyLong())).thenReturn(client);
when(client.findAllTopologySuffixes()).thenReturn(List.of(suffix));
when(client.findTopologySegments(any())).thenReturn(List.of(segment));
assertFalse(underTest.checkStatus(pollerObject));
}
use of com.sequenceiq.freeipa.service.freeipa.cleanup.FreeIpaServerDeletionPollerObject in project cloudbreak by hortonworks.
the class FreeIplaServiceDeletionListenerTaskTest method testCheckStatusTrue.
@Test
void testCheckStatusTrue() throws Exception {
FreeIpaServerDeletionPollerObject pollerObject = new FreeIpaServerDeletionPollerObject(1L, Set.of("example0.com"));
FreeIpaClient client = mock(FreeIpaClient.class);
TopologySuffix suffix = new TopologySuffix();
suffix.setCn("ca");
TopologySegment segment = new TopologySegment();
segment.setRightNode("example1.com");
segment.setLeftNode("example2.com");
when(freeIpaClientFactory.getFreeIpaClientForStackId(anyLong())).thenReturn(client);
when(client.findAllTopologySuffixes()).thenReturn(List.of(suffix));
when(client.findTopologySegments(any())).thenReturn(List.of(segment));
assertTrue(underTest.checkStatus(pollerObject));
}
Aggregations