mchades commented on code in PR #12585:
URL: https://github.com/apache/gravitino/pull/12585#discussion_r4260682239
##########
core/src/test/java/org/apache/gravitino/listener/api/event/TestCatalogEvent.java:
##########
@@ -357,6 +363,72 @@ void testListCatalogInfoFailureEvent() {
Assertions.assertEquals(OperationStatus.FAILURE, event.operationStatus());
}
+ @Test
+ void testTestConnectionEvent() throws Exception {
+ NameIdentifier identifier = NameIdentifier.of("metalake", catalog.name());
+ dispatcher.testConnection(
+ identifier, catalog.type(), catalog.provider(), catalog.comment(),
catalog.properties());
+ Event event = dummyEventListener.popPostEvent();
+ Assertions.assertEquals(identifier, event.identifier());
+ Assertions.assertEquals(TestConnectionEvent.class, event.getClass());
+ Assertions.assertEquals(OperationType.TEST_CONNECTION_CATALOG,
event.operationType());
+ Assertions.assertEquals(OperationStatus.SUCCESS, event.operationStatus());
+
+ PreEvent preEvent = dummyEventListener.popPreEvent();
+ Assertions.assertEquals(identifier, preEvent.identifier());
+ Assertions.assertEquals(TestConnectionPreEvent.class, preEvent.getClass());
+ Assertions.assertEquals(OperationType.TEST_CONNECTION_CATALOG,
preEvent.operationType());
+ Assertions.assertEquals(OperationStatus.UNPROCESSED,
preEvent.operationStatus());
Review Comment:
Ordering is already verified in `TestCatalogConnectionEvent.assertEvents`
using Mockito `InOrder`: pre-event, delegate call, then post-event, for every
overload on both success and failure. `DummyEventListener` stores pre/post
events separately, so changing the pop order would not verify dispatch order.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]