DynamoDBSSHRecordStore implements SSHRecordStore { @Override public boolean enableNotifications(NotificationManager notificationManager, RolesProvider rolesProvider, final String serverName) { if (ztsClientNotificationSender != null) { return ztsClientNotificationSender.init(notificationManager, rolesProvider, serverName); } else { LOGGER.warn("Can't enable notifications as ZTSClientNotificationSenderImpl wasn't provided in CTOR"); return false; } } DynamoDBSSHRecordStore(AmazonDynamoDB client, final String tableName, ZTSClientNotificationSenderImpl ztsClientNotificationSender); @Override SSHRecordStoreConnection getConnection(); @Override void setOperationTimeout(int opTimeout); @Override void clearConnections(); @Override void log(final Principal principal, final String ip, final String service,
                    final String instanceId); @Override boolean enableNotifications(NotificationManager notificationManager, RolesProvider rolesProvider, final String serverName);  }
@Test public void testEnableNotifications() { DynamoDBSSHRecordStore store = new DynamoDBSSHRecordStore(dbClient, "Athenz-ZTS-Table", null); boolean isEnabled = store.enableNotifications(null, null, null); assertFalse(isEnabled); ZTSClientNotificationSenderImpl ztsClientNotificationSender = new ZTSClientNotificationSenderImpl(); store = new DynamoDBSSHRecordStore(dbClient, "Athenz-ZTS-Table", ztsClientNotificationSender); isEnabled = store.enableNotifications(null, null, null); assertFalse(isEnabled); NotificationManager notificationManager = Mockito.mock(NotificationManager.class); RolesProvider rolesProvider = Mockito.mock(RolesProvider.class); String serverName = "testServer"; isEnabled = store.enableNotifications(notificationManager, rolesProvider, serverName); assertTrue(isEnabled); }