@Test public void say_valid() { IHelloService target = new HelloValidationService(); String responseXml = target.say(ClassLoader.getSystemResourceAsStream("hello-validation-valid.xml")); assertThat(extract(responseXml, "/helloValidationResponse/message/text()"), is("Hello, JAXB!")); }
@Test(expected = RuntimeException.class) public void say_invalid() { IHelloService target = new HelloValidationService(); target.say(ClassLoader.getSystemResourceAsStream("hello-validation-invalid.xml")); }