Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 004300b

Browse files
committed
Isolated PostConstructInvokerTest
1 parent 57b9595 commit 004300b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

webtester-core/src/test/java/info/novatec/testit/webtester/internal/PostConstructInvokerTest.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,22 @@
1212

1313
import info.novatec.testit.webtester.browser.Browser;
1414
import info.novatec.testit.webtester.browser.WebDriverBrowser;
15+
import info.novatec.testit.webtester.config.BaseConfiguration;
16+
import info.novatec.testit.webtester.config.Configuration;
1517
import info.novatec.testit.webtester.internal.postconstruct.PostConstructInvoker;
1618
import info.novatec.testit.webtester.pages.Page;
1719

1820

1921
public class PostConstructInvokerTest {
2022

2123
@Test
22-
public void testInvocationOfPostConstructMethodsOfPageClass(){
24+
public void testInvocationOfPostConstructMethodsOfPageClass() {
2325

2426
TestContext.clear();
2527

2628
WebDriver webDriver = mock(WebDriver.class);
27-
Browser browser = WebDriverBrowser.buildForWebDriver(webDriver);
29+
Configuration configuration = new BaseConfiguration();
30+
Browser browser = WebDriverBrowser.forWebDriver(webDriver).withConfiguration(configuration).build();
2831

2932
TestPage page = new PageFactory(browser).page(TestPage.class);
3033
PostConstructInvoker.invokePostConstructMethods(TestPage.class, page);
@@ -35,20 +38,21 @@ public void testInvocationOfPostConstructMethodsOfPageClass(){
3538

3639
private static class TestContext {
3740
static List<String> invokedMethods = new LinkedList<>();
38-
static void clear(){
41+
42+
static void clear() {
3943
invokedMethods.clear();
4044
}
4145
}
4246

4347
public interface TestPage extends Page {
4448

4549
@PostConstruct
46-
default void assertSomething(){
50+
default void assertSomething() {
4751
TestContext.invokedMethods.add("assertSomethingOnPage");
4852
}
4953

5054
@PostConstruct
51-
default void assertSomethingElse(){
55+
default void assertSomethingElse() {
5256
TestContext.invokedMethods.add("assertSomethingElseOnPage");
5357
}
5458

0 commit comments

Comments
 (0)