@Test
    void testPropertySetting() throws Exception {
        @SuppressWarnings("unchecked")
        TypeEncounter<SomeInjectableBean> encounter = mock(TypeEncounter.class);

        @SuppressWarnings("unchecked")
        Provider<Injector> injectorProvider = mock(Provider.class);
        Injector injector = mock(Injector.class);

        when(encounter.getProvider(Injector.class)).then(args -> injectorProvider);

        when(injectorProvider.get()).then(args -> injector);

        @SuppressWarnings("unchecked")
        ArgumentCaptor<MembersInjector<SomeInjectableBean>> captor = ArgumentCaptor.forClass(MembersInjector.class);

        SecurityManager securityManager = mock(SecurityManager.class);
        String property = "myPropertyValue";

        when(injector.getInstance(Key.get(SecurityManager.class))).then(args -> securityManager);
        when(injector.getInstance(Key.get(String.class, Names.named("shiro.myProperty")))).then(args -> property);
        when(injector.getInstance(Key.get(String.class, Names.named("shiro.unavailableProperty"))))
                .thenThrow(new ConfigurationException(Collections.singleton(new Message("Not Available!"))));
        when((Map) injector.getInstance(BeanTypeListener.MAP_KEY)).then(args -> Collections.EMPTY_MAP);

        BeanTypeListener underTest = new BeanTypeListener();

        underTest.hear(TypeLiteral.get(SomeInjectableBean.class), encounter);

        SomeInjectableBean bean = new SomeInjectableBean();

        verify(encounter).register(captor.capture());
        captor.getValue().injectMembers(bean);

        assertSame(securityManager, bean.securityManager);
        assertSame(property, bean.myProperty);
        assertNull(bean.unavailableProperty);
    }
Test Cases::
Test package matching
injects on classes in shiro package and sub packages
excludes classes in shiro-guice package and sub packages
Test that properties are set properly
ensure optional
ensure property names are correct
ensure "named" properties require a name, and unnamed do not
support/guice/src/test/java/org/apache/shiro/guice/BeanTypeListenerTest.java