@Test(expected = IllegalArgumentException.class) public void testProvideNonPositiveNumberOfTargets() { targetProvider.provideTargets(0); }
@Override public List<String> provideTargets(final int targetsNum) { checkArgument(targetsNum > 0, "targets number cannot be %s", targetsNum); final List<String> targets = loadBalancer.provideTargets(targetsNum); checkState(!targets.isEmpty(), "No targets are currently registered for module %s", healthyTargetsList.getModule()); return targets; }
ConsulBasedTargetProvider implements TargetProvider, HealthyTargetsList.TargetsChangedListener { @Override public List<String> provideTargets(final int targetsNum) { checkArgument(targetsNum > 0, "targets number cannot be %s", targetsNum); final List<String> targets = loadBalancer.provideTargets(targetsNum); checkState(!targets.isEmpty(), "No targets are currently registered for module %s", healthyTargetsList.getModule()); return targets; } }
ConsulBasedTargetProvider implements TargetProvider, HealthyTargetsList.TargetsChangedListener { @Override public List<String> provideTargets(final int targetsNum) { checkArgument(targetsNum > 0, "targets number cannot be %s", targetsNum); final List<String> targets = loadBalancer.provideTargets(targetsNum); checkState(!targets.isEmpty(), "No targets are currently registered for module %s", healthyTargetsList.getModule()); return targets; } ConsulBasedTargetProvider(final HealthyTargetsList healthyTargetsList, final String urlSuffix, final Map<String, Integer> tag2weight);  ConsulBasedTargetProvider(final HealthyTargetsList healthyTargetsList, final String urlSuffix, final Map<String, Integer> tag2weight, final LoadBalancer loadBalancer); }
ConsulBasedTargetProvider implements TargetProvider, HealthyTargetsList.TargetsChangedListener { @Override public List<String> provideTargets(final int targetsNum) { checkArgument(targetsNum > 0, "targets number cannot be %s", targetsNum); final List<String> targets = loadBalancer.provideTargets(targetsNum); checkState(!targets.isEmpty(), "No targets are currently registered for module %s", healthyTargetsList.getModule()); return targets; } ConsulBasedTargetProvider(final HealthyTargetsList healthyTargetsList, final String urlSuffix, final Map<String, Integer> tag2weight);  ConsulBasedTargetProvider(final HealthyTargetsList healthyTargetsList, final String urlSuffix, final Map<String, Integer> tag2weight, final LoadBalancer loadBalancer); @Override String getTargetLogicalName(); @Override String provideTarget(); @Override List<String> provideTargets(final int targetsNum); @Override void onTargetsChanged(final List<HealthInfoInstance> healthTargets); @Override void targetDispatched(final String target); @Override void targetDispatchEnded(final String target, final boolean success, final long startTimeNanos); }
ConsulBasedTargetProvider implements TargetProvider, HealthyTargetsList.TargetsChangedListener { @Override public List<String> provideTargets(final int targetsNum) { checkArgument(targetsNum > 0, "targets number cannot be %s", targetsNum); final List<String> targets = loadBalancer.provideTargets(targetsNum); checkState(!targets.isEmpty(), "No targets are currently registered for module %s", healthyTargetsList.getModule()); return targets; } ConsulBasedTargetProvider(final HealthyTargetsList healthyTargetsList, final String urlSuffix, final Map<String, Integer> tag2weight);  ConsulBasedTargetProvider(final HealthyTargetsList healthyTargetsList, final String urlSuffix, final Map<String, Integer> tag2weight, final LoadBalancer loadBalancer); @Override String getTargetLogicalName(); @Override String provideTarget(); @Override List<String> provideTargets(final int targetsNum); @Override void onTargetsChanged(final List<HealthInfoInstance> healthTargets); @Override void targetDispatched(final String target); @Override void targetDispatchEnded(final String target, final boolean success, final long startTimeNanos);  }