@Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); subject = new GlobalAlternativeSelector(); subject.loadApplicationAlternatives(bbd); ccl = Thread.currentThread().getContextClassLoader(); when(pat.getAnnotatedType()).thenReturn(at); }
@Test(expected = IllegalStateException.class) public void testLoadApplicationAlternatives_CCL_noBeansXml() throws Exception { final ClassLoader cl = mock(ClassLoader.class); Thread.currentThread().setContextClassLoader(cl); subject.loadApplicationAlternatives(bbd); }