### Question:
PooledService implements Service { @Override public ServiceState state() { return endpointStates.state(); } PooledService(final ServiceConfig serviceConfig, final ServiceContext serviceContext); @Override void send(final R request); @Override synchronized void connect(); @Override synchronized void disconnect(); @Override ServiceContext context(); @Override ServiceState state(); @Override Flux<ServiceState> states(); @Override Stream<EndpointDiagnostics> diagnostics(); static final Duration DEFAULT_IDLE_TIME_CHECK_INTERVAL; }### Answer:
@Test void startsIdleWithNoMinEndpoints() { MockedService service = new MockedService(new MockedServiceConfig(0, 1), () -> null); assertEquals(ServiceState.IDLE, service.state()); }
@Test void startsDisconnectedWithMinEndpoints() { MockedService service = new MockedService(new MockedServiceConfig(1, 1), () -> null); assertEquals(ServiceState.DISCONNECTED, service.state()); }