Hi,
I’m wondering why a service that is added to a binder using the `AbstractBinder.bind(T service)` method does not report Singleton as its scope, but instead PerLookup. On the other hand, the service indeed acts as singleton.
Here is the test:
```
public class ScopeTest {
@Service
static class MyService {
}
@Test
public void testScope() {
final MyService service = new MyService();
Binder binder = new AbstractBinder() {
@Override
protected void configure() {
bind(service);
}
};
final ServiceLocator sl = ServiceLocatorUtilities.bind(binder);
final ServiceHandle<MyService> handle = sl.getServiceHandle(MyService.class);
// EXPECTED
assertEquals(handle.getActiveDescriptor().getScopeAnnotation(), Singleton.class);
// INSTEAD
assertEquals(handle.getActiveDescriptor().getScopeAnnotation(), PerLookup.class);
final MyService s1 = sl.getService(MyService.class);
assertEquals(s1, service);
final MyService s2 = sl.getService(MyService.class);
assertEquals(s2, service);
}
}
```
Thanks a lot!
Filip