use of io.trino.testing.TestingEventListenerManager in project trino by trinodb.
the class TestAccessControlManager method testRegisterMultipleEventListeners.
@Test
public void testRegisterMultipleEventListeners() throws IOException {
EventListener firstListener = new EventListener() {
};
EventListener secondListener = new EventListener() {
};
String systemAccessControlName = "event-listening-sac";
TestingEventListenerManager eventListenerManager = emptyEventListenerManager();
AccessControlManager accessControlManager = createAccessControlManager(eventListenerManager, ImmutableList.of("access-control.name=" + systemAccessControlName));
accessControlManager.addSystemAccessControlFactory(eventListeningSystemAccessControlFactory(systemAccessControlName, firstListener, secondListener));
accessControlManager.loadSystemAccessControl();
assertThat(eventListenerManager.getConfiguredEventListeners()).contains(firstListener, secondListener);
}
use of io.trino.testing.TestingEventListenerManager in project trino by trinodb.
the class TestAccessControlManager method testRegisterSingleEventListener.
@Test
public void testRegisterSingleEventListener() throws IOException {
EventListener expectedListener = new EventListener() {
};
String systemAccessControlName = "event-listening-sac";
TestingEventListenerManager eventListenerManager = emptyEventListenerManager();
AccessControlManager accessControlManager = createAccessControlManager(eventListenerManager, ImmutableList.of("access-control.name=" + systemAccessControlName));
accessControlManager.addSystemAccessControlFactory(eventListeningSystemAccessControlFactory(systemAccessControlName, expectedListener));
accessControlManager.loadSystemAccessControl();
assertThat(eventListenerManager.getConfiguredEventListeners()).contains(expectedListener);
}
Aggregations