### Question:
PageAssert extends AbstractAssert<PageAssert, FluentPage> implements PageStateAssert { @Override public PageAssert hasPageSourceContaining(String value) { String pageSource = actual.getDriver().getPageSource(); if (!pageSource.contains(value)) { failWithMessage("Current page source does not contain: " + value); } return this; } PageAssert(FluentPage actual); @Override PageAssert hasElement(FluentWebElement element); @Override PageAssert hasElements(FluentList<? extends FluentWebElement> fluentList); @Override PageAssert hasElementDisplayed(FluentWebElement element); @Override PageAssert hasTitle(String title); @Override PageAssert hasUrl(String url); @Override PageAssert hasPageSourceContaining(String value); @Override PageAssert hasExpectedUrl(); @Override PageAssert hasExpectedElements(); @Deprecated @Override PageAssert isAt();  }### Answer:
@Test public void hasPageSourceContainingOk() { String source = "<html></html>"; doReturn(source).when(driver).getPageSource(); pageAssert.hasPageSourceContaining(source); }
@Test public void hasPageSourceContainingKo() { doReturn("<html></html>").when(driver).getPageSource(); assertThatAssertionErrorIsThrownBy(() -> pageAssert.hasPageSourceContaining("<body>")) .hasMessage("Current page source does not contain: <body>"); }