/** * Creating snapshot when HMS doesn't have any data */ @Test public void testSnapshotCreationWithNoHmsData() throws Exception { MockClient mockClient = new MockClient(new HiveSnapshot(), 1); client.setClient(mockClient.client); // Make sure that client is connected Assert.assertTrue(client.isConnected()); PathsImage snapshotInfo = client.getFullSnapshot(); Assert.assertTrue(snapshotInfo.getPathImage().isEmpty()); Assert.assertFalse("FullUpdateInitializer is not expected to be in progress", SentryStateBank.isEnabled(FullUpdateInitializerState.COMPONENT, FullUpdateInitializerState.FULL_SNAPSHOT_INPROGRESS)); Assert.assertTrue(SentryStateBank.wereStatesEnabled(FullUpdateInitializerState.COMPONENT, new HashSet<SentryState>( Arrays.asList(FullUpdateInitializerState.FULL_SNAPSHOT_INPROGRESS)))); }
Mockito.when(mockClient.client.getCurrentNotificationEventId()). thenReturn(new CurrentNotificationEventId(mockClient.eventId)); client.setClient(mockClient.client); hiveConnectionFactory.setClient(mockClient);
final MockClient mockClient = new MockClient(snap, 1); client.setClient(mockClient.client); hiveConnectionFactory.setClient(mockClient);