Search in sources :

Example 1 with NoResourceForDependency

use of se.jbee.inject.UnresolvableDependency.NoResourceForDependency in project silk by jbee.

the class TestRequiredProvidedBinds method thatUnusedProvidedBindIsNotAddedToInjectorContext.

@Test
public void thatUnusedProvidedBindIsNotAddedToInjectorContext() {
    Injector injector = Bootstrap.injector(RequiredProvidedBindsBundle.class);
    try {
        injector.resolve(dependency(UnusedImpl.class));
        fail("Should not be bound and therefore throw below exception");
    } catch (NoResourceForDependency e) {
    // expected this
    } catch (Throwable e) {
        fail("Expected another exception but got: " + e);
    }
}
Also used : NoResourceForDependency(se.jbee.inject.UnresolvableDependency.NoResourceForDependency) Injector(se.jbee.inject.Injector) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Injector (se.jbee.inject.Injector)1 NoResourceForDependency (se.jbee.inject.UnresolvableDependency.NoResourceForDependency)1