use of org.hamcrest.core.StringContains in project jbosstools-openshift by jbosstools.
the class CreateServerAdapterTest method finishNewServerAdapterWizardAndVerifyExistence.
public void finishNewServerAdapterWizardAndVerifyExistence() {
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.ADAPTER));
boolean jobExists = false;
try {
new WaitUntil(new JobIsRunning(new StringContains(JOB_NAME)), TimePeriod.getCustom(5));
jobExists = true;
} catch (WaitTimeoutExpiredException e) {
// job is not running, do nothing
}
if (jobExists) {
new WaitUntil(new JobIsKilled(JOB_NAME), TimePeriod.VERY_LONG);
}
assertTrue("OpenShift server adapter was not created.", new ServerAdapterExists(Version.OPENSHIFT3, OpenShiftResources.EAP_SERVICE, "Service").test());
}
use of org.hamcrest.core.StringContains in project nextprot-api by calipho-sib.
the class XMLWebTest method shouldGetXmlWellFormatted.
@Test
public void shouldGetXmlWellFormatted() throws Exception {
ResultActions result = this.mockMvc.perform(get("/entry/NX_P01308.xml"));
result.andExpect(xpath("//publication[@id='28338750']").exists());
// β-sheets
result.andExpect(content().string(new StringContains("β-sheets")));
}
use of org.hamcrest.core.StringContains in project cactoos by yegor256.
the class UncheckedTextTest method rethrowsCheckedToUncheckedException.
@Test
void rethrowsCheckedToUncheckedException() {
final String msg = "intended";
new Assertion<>("Must throw an exception when something goes wrong", new UncheckedText(() -> {
throw new IOException(msg);
})::asString, new Throws<>(new StringContains(msg), RuntimeException.class)).affirm();
}
use of org.hamcrest.core.StringContains in project sling by apache.
the class GetPostTest method testValidGet.
@Test
public void testValidGet() throws ClientException, URISyntaxException {
MicrodataHtmlClient client = new MicrodataHtmlClient(httpServer.getURI().toString());
Document doc = client.get(GET_URL);
Assert.assertThat("GET request failed", doc.toString(), new StringContains(OK_RESPONSE));
}
use of org.hamcrest.core.StringContains in project verify-hub by alphagov.
the class TransactionConfigEntityDataTest method shouldThrowExceptionWhenLoadingConfigFileWithInvalidUserAccountAttributes.
@Test
public void shouldThrowExceptionWhenLoadingConfigFileWithInvalidUserAccountAttributes() throws IOException {
String badAttribute = "[ \"FIRST_NAME\", \"FIRST_NAME_VERIFIED\", \"INVALID_ATTRIBUTE\" ]";
InputStream badAttributeStream = new ByteArrayInputStream(badAttribute.getBytes());
ObjectMapper mapper = new ObjectMapper();
exception.expect(InvalidFormatException.class);
StringContains matcher = new StringContains("\"INVALID_ATTRIBUTE\": value not one of declared Enum instance names: [MIDDLE_NAME_VERIFIED, MIDDLE_NAME, DATE_OF_BIRTH, CURRENT_ADDRESS_VERIFIED, FIRST_NAME, SURNAME, SURNAME_VERIFIED, FIRST_NAME_VERIFIED, CURRENT_ADDRESS, DATE_OF_BIRTH_VERIFIED, ADDRESS_HISTORY, CYCLE_3]");
exception.expectMessage(matcher);
mapper.readValue(badAttributeStream, mapper.getTypeFactory().constructCollectionType(List.class, UserAccountCreationAttribute.class));
}
Aggregations