use of org.apache.druid.discovery.DruidService in project druid by druid-io.
the class DiscoverySideEffectsProviderTest method setUp.
@Before
public void setUp() {
nodeRole = NodeRole.HISTORICAL;
lifecycleHandlers = new ArrayList<>();
Mockito.doAnswer((invocation) -> {
DiscoveryDruidNode discoveryDruidNode = invocation.getArgument(0);
boolean isAllServicesDiscoverable = discoveryDruidNode.getServices().values().stream().allMatch(DruidService::isDiscoverable);
Assert.assertTrue(isAllServicesDiscoverable);
return null;
}).when(discoverableOnlyAnnouncer).announce(ArgumentMatchers.any(DiscoveryDruidNode.class));
Mockito.doAnswer((invocation) -> lifecycleHandlers.add(invocation.getArgument(0))).when(lifecycle).addHandler(ArgumentMatchers.any(Lifecycle.Handler.class), ArgumentMatchers.eq(Lifecycle.Stage.ANNOUNCEMENTS));
target = DiscoverySideEffectsProvider.withLegacyAnnouncer();
}
Aggregations