Skip to content

Commit

Permalink
Fix failed BrokerRegistryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
BewareMyPower committed Sep 27, 2024
1 parent ef0a8eb commit 5c720d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ protected enum State {
Closed
}

private final AtomicReference<State> state = new AtomicReference<>(State.Init);
@VisibleForTesting
final AtomicReference<State> state = new AtomicReference<>(State.Init);

public BrokerRegistryImpl(PulsarService pulsar) {
this.pulsar = pulsar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ public void testKeyPath() {
assertEquals(keyPath, LOADBALANCE_BROKERS_ROOT + "/brokerId");
}

public BrokerRegistryImpl.State getState(BrokerRegistryImpl brokerRegistry) {
return WhiteboxImpl.getInternalState(brokerRegistry, BrokerRegistryImpl.State.class);
private static BrokerRegistryImpl.State getState(BrokerRegistryImpl brokerRegistry) {
return brokerRegistry.state.get();
}
}

0 comments on commit 5c720d8

Please sign in to comment.