Skip to content

Commit

Permalink
Remove 2nd case
Browse files Browse the repository at this point in the history
  • Loading branch information
sushantmane committed Nov 23, 2024
1 parent 2842dd0 commit 8949902
Showing 1 changed file with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
Expand Down Expand Up @@ -740,7 +739,7 @@ public void getKeyLevelLockMaxPoolSizeBasedOnServerConfigTest() {

@Test
public void testConsumerSubscribe() {
// Case 1: AA store ingestion task with invalid pubsub address
// Case: AA store ingestion task with invalid pubsub address
ActiveActiveStoreIngestionTask ingestionTask = mock(ActiveActiveStoreIngestionTask.class);
VeniceServerConfig mockServerConfig = mock(VeniceServerConfig.class);

Expand All @@ -762,20 +761,5 @@ public void testConsumerSubscribe() {
"Exception message should contain the expected message but found: " + exception.getMessage());

verify(ingestionTask, times(1)).consumerSubscribe(pubSubTopicPartition, 100L, "invalidPubSubAddress");

// Case 2: DaVinci client
ActiveActiveStoreIngestionTask dvcIngestionTask = mock(ActiveActiveStoreIngestionTask.class);
doCallRealMethod().when(dvcIngestionTask).consumerSubscribe(any(), anyLong(), anyString());
when(dvcIngestionTask.getServerConfig()).thenReturn(mockServerConfig);
when(dvcIngestionTask.isDaVinciClient()).thenReturn(true);
when(mockServerConfig.getKafkaClusterUrlToIdMap()).thenReturn(Object2IntMaps.emptyMap());
try {
dvcIngestionTask.consumerSubscribe(pubSubTopicPartition, 100L, "validPubSubAddress");
} catch (Exception e) {
assertFalse(
e.getMessage().contains("is not in the pubsub cluster map"),
"Exception message should not contain the expected message but found: " + e.getMessage());
}
verify(dvcIngestionTask, times(1)).consumerSubscribe(pubSubTopicPartition, 100L, "validPubSubAddress");
}
}

0 comments on commit 8949902

Please sign in to comment.