use of org.apache.wicket.spring.test.ApplicationContextMock in project the-app by devops-dojo.
the class AbstractWicketTest method initializeWicketTester.
@Before
public void initializeWicketTester() throws Exception {
initMocks(this);
ApplicationContextMock appctx = initializeApplicationContext();
TestShopApplication application = new TestShopApplication(appctx);
wicketTester = new WicketTester(application);
}
use of org.apache.wicket.spring.test.ApplicationContextMock in project the-app by devops-dojo.
the class NavigationProviderImplTest method tearDown.
@After
public void tearDown() {
NavigationProvider navigationProvider = new NavigationProviderImpl(new ApplicationContextMock(), authenticationService);
navigationProvider.setClassPathToScan("io.github.zutherb.appstash.shop.ui.page");
}
use of org.apache.wicket.spring.test.ApplicationContextMock in project the-app by devops-dojo.
the class NavigationProviderImplTest method testRealNavigation.
@Test
public void testRealNavigation() {
ApplicationContextMock applicationContext = new ApplicationContextMock();
applicationContext.putBean("cart", mock(Cart.class));
applicationContext.putBean("authenticationService", mock(AuthenticationService.class));
NavigationProvider navigationProvider = new NavigationProviderImpl(applicationContext, authenticationService);
Navigation realNavigation = navigationProvider.getNavigation();
assertNotNull(realNavigation);
assertTrue("Main Navigation must not empty", !realNavigation.getMainNavigationGroup().getNavigationEntries().isEmpty());
}
use of org.apache.wicket.spring.test.ApplicationContextMock in project the-app by devops-dojo.
the class NavigationProviderImplTest method setup.
@Before
public void setup() {
initMocks(this);
when(authenticationService.isAuthorized()).thenReturn(true);
when(authenticationService.isAuthorized(anyString())).thenReturn(true);
ApplicationContextMock applicationContext = new ApplicationContextMock();
applicationContext.putBean("authenticationService", authenticationService);
applicationContext.putBean("cart", cart);
NavigationProvider navigationProvider = new NavigationProviderImpl(applicationContext, authenticationService);
navigation = navigationProvider.getNavigation();
}
use of org.apache.wicket.spring.test.ApplicationContextMock in project wicket by apache.
the class SpringBeanLocatorTest method before.
/**
*/
@Before
public void before() {
ctx = new ApplicationContextMock();
ctxLocator = new SpringContextLocatorMock(ctx);
}
Aggregations