Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Dec 9, 2022
1 parent 565192e commit 02c38f5
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,23 +300,25 @@ public void testBookKeeperIoThreadsConfiguration() throws Exception {
}

@Test
public void testBookKeeperLimitStatsLoggingConfiguration() {
public void testBookKeeperLimitStatsLoggingConfiguration() throws Exception {
BookKeeperClientFactoryImpl factory = new BookKeeperClientFactoryImpl();
ServiceConfiguration conf = new ServiceConfiguration();
assertEquals(factory.createBkClientConfiguration(mock(MetadataStoreExtended.class), conf)
.getLimitStatsLogging(), false);
assertFalse(
factory.createBkClientConfiguration(mock(MetadataStoreExtended.class), conf).getLimitStatsLogging());
EventLoopGroup eventLoopGroup = mock(EventLoopGroup.class);
BookKeeper.Builder builder = factory.getBookKeeperBuilder(conf, eventLoopGroup, mock(StatsLogger.class),
factory.createBkClientConfiguration(mock(MetadataStoreExtended.class), conf));
ClientConfiguration clientConfiguration = Whitebox.getInternalState(builder, "conf");
assertEquals(clientConfiguration.getLimitStatsLogging(), false);
ClientConfiguration clientConfiguration =
(ClientConfiguration) FieldUtils.readField(builder, "conf", true);
assertFalse(clientConfiguration.getLimitStatsLogging());

conf.setBookkeeperClientLimitStatsLogging(true);
assertEquals(factory.createBkClientConfiguration(mock(MetadataStoreExtended.class), conf)
.getLimitStatsLogging(), true);
assertTrue(factory.createBkClientConfiguration(mock(MetadataStoreExtended.class), conf)
.getLimitStatsLogging());
builder = factory.getBookKeeperBuilder(conf, eventLoopGroup, mock(StatsLogger.class),
factory.createBkClientConfiguration(mock(MetadataStoreExtended.class), conf));
clientConfiguration = Whitebox.getInternalState(builder, "conf");
assertEquals(clientConfiguration.getLimitStatsLogging(), true);
clientConfiguration =
(ClientConfiguration) FieldUtils.readField(builder, "conf", true);
assertTrue(clientConfiguration.getLimitStatsLogging());
}
}

0 comments on commit 02c38f5

Please sign in to comment.