Search in sources :

Example 16 with Events

use of io.wring.model.Events in project wring by yegor256.

the class DyEventsITCase method appendsToExistingEvents.

/**
 * DyEvents can append text to.
 * @throws Exception If some problem inside
 */
@Test
public void appendsToExistingEvents() throws Exception {
    final User user = new DyUser(new Dynamo(), "peter");
    final Events events = user.events();
    final String title = "a simple title";
    events.post(title, "\n\tfirst body");
    events.post(title, "\n\u0000\u00fdin between");
    events.post(title, "second body\n\n");
    MatcherAssert.assertThat(new Xembler(events.iterate().iterator().next().asXembly()).xml(), XhtmlMatchers.hasXPaths("/event/text[contains(.,'first')]", "/event/text[contains(.,'second body')]", "/event/text[not(contains(.,'first body\n'))]"));
}
Also used : User(io.wring.model.User) Events(io.wring.model.Events) Xembler(org.xembly.Xembler) Test(org.junit.Test)

Aggregations

Events (io.wring.model.Events)16 Test (org.junit.Test)15 Event (io.wring.model.Event)5 User (io.wring.model.User)5 InputStreamOf (org.cactoos.io.InputStreamOf)3 Xembler (org.xembly.Xembler)3 FkBase (io.wring.fake.FkBase)1 FkPipe (io.wring.fake.FkPipe)1 Base (io.wring.model.Base)1 Pipe (io.wring.model.Pipe)1 XePrint (io.wring.model.XePrint)1 IOException (java.io.IOException)1 Json (javax.json.Json)1 JsonObject (javax.json.JsonObject)1 Proc (org.cactoos.Proc)1 FuncOf (org.cactoos.func.FuncOf)1 FuncWithFallback (org.cactoos.func.FuncWithFallback)1 UncheckedFunc (org.cactoos.func.UncheckedFunc)1 BytesOf (org.cactoos.io.BytesOf)1 ReaderOf (org.cactoos.io.ReaderOf)1