Search in sources :

Example 1 with CdiServiceDiscovery

use of io.crnk.cdi.internal.CdiServiceDiscovery in project crnk-framework by crnk-project.

the class CdiServiceDiscoveryTest method testSetter.

@Test
public void testSetter() {
    CdiServiceDiscovery discovery = new CdiServiceDiscovery();
    BeanManager beanManager = discovery.getBeanManager();
    Assert.assertNotNull(discovery.getBeanManager());
    BeanManager mock = Mockito.mock(BeanManager.class);
    discovery.setBeanManager(mock);
    Assert.assertSame(mock, discovery.getBeanManager());
    Assert.assertNotSame(mock, beanManager);
}
Also used : CdiServiceDiscovery(io.crnk.cdi.internal.CdiServiceDiscovery) BeanManager(javax.enterprise.inject.spi.BeanManager) Test(org.junit.Test)

Aggregations

CdiServiceDiscovery (io.crnk.cdi.internal.CdiServiceDiscovery)1 BeanManager (javax.enterprise.inject.spi.BeanManager)1 Test (org.junit.Test)1