Skip to content

Commit

Permalink
- Remove unnecessary code from TestTagEvent.java.
Browse files Browse the repository at this point in the history
  • Loading branch information
TungYuChiang committed Feb 4, 2025
1 parent 0b78a76 commit 06eead0
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package org.apache.gravitino.listener.api.event;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -89,19 +88,18 @@ void testGetTagEvent() {
void testListTagEvent() {
dispatcher.listTags("metalake");
Event event = dummyEventListener.popPostEvent();
Assertions.assertEquals(ListTagEvent.class, event.getClass());
Assertions.assertEquals(ListTagsEvent.class, event.getClass());
Assertions.assertEquals(OperationType.LIST_TAG, event.operationType());
Assertions.assertEquals(OperationStatus.SUCCESS, event.operationStatus());
}

@Test
void testListTagInfoEvent() {
Tag[] result = dispatcher.listTagsInfo("metalake");
dispatcher.listTagsInfo("metalake");
Event event = dummyEventListener.popPostEvent();
Assertions.assertEquals(ListTagInfoEvent.class, event.getClass());
Assertions.assertEquals(ListTagsInfoEvent.class, event.getClass());
Assertions.assertEquals(OperationType.LIST_TAGS_INFO, event.operationType());
Assertions.assertEquals(OperationStatus.SUCCESS, event.operationStatus());
Assertions.assertEquals(result, ((ListTagInfoEvent) event).tags());
}

@Test
Expand Down Expand Up @@ -141,8 +139,6 @@ void testGetTagForMetadataObjectEvent() {
Event event = dummyEventListener.popPostEvent();

Assertions.assertEquals(GetTagForMetadataObjectEvent.class, event.getClass());
Assertions.assertEquals(
metadataObject, ((GetTagForMetadataObjectEvent) event).metadataObject());
Assertions.assertEquals(OperationType.GET_TAG_FOR_METADATA_OBJECT, event.operationType());
Assertions.assertEquals(OperationStatus.SUCCESS, event.operationStatus());
}
Expand Down Expand Up @@ -171,8 +167,6 @@ void testAssociateTagsForMetadataObjectEvent() {
Event event = dummyEventListener.popPostEvent();

Assertions.assertEquals(AssociateTagsForMetadataObjectEvent.class, event.getClass());
Assertions.assertEquals(
metadataObject, ((AssociateTagsForMetadataObjectEvent) event).metadataObject());
Assertions.assertArrayEquals(
tagsToAssociate, ((AssociateTagsForMetadataObjectEvent) event).tagsToAdd());
Assertions.assertArrayEquals(
Expand All @@ -193,8 +187,6 @@ void testListTagsForMetadataObjectEvent() {
Event event = dummyEventListener.popPostEvent();

Assertions.assertEquals(ListTagsForMetadataObjectEvent.class, event.getClass());
Assertions.assertEquals(
metadataObject, ((ListTagsForMetadataObjectEvent) event).metadataObject());
Assertions.assertEquals(OperationType.LIST_TAGS_FOR_METADATA_OBJECT, event.operationType());
Assertions.assertEquals(OperationStatus.SUCCESS, event.operationStatus());
}
Expand All @@ -210,8 +202,6 @@ void testListTagsInfoForMetadataObjectEvent() {
Event event = dummyEventListener.popPostEvent();

Assertions.assertEquals(ListTagsInfoForMetadataObjectEvent.class, event.getClass());
Assertions.assertEquals(
metadataObject, ((ListTagsInfoForMetadataObjectEvent) event).metadataObject());
Assertions.assertEquals(
OperationType.LIST_TAGS_INFO_FOR_METADATA_OBJECT, event.operationType());
Assertions.assertEquals(OperationStatus.SUCCESS, event.operationStatus());
Expand Down

0 comments on commit 06eead0

Please sign in to comment.