Skip to content

Commit

Permalink
Add messages to samples test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
astefanutti committed Dec 4, 2015
1 parent 3df4bdb commit 9246568
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ public static Archive<?> deployment() {
public static TestRule verifier = new LogVerifier() {
@Override
protected void verify() throws Throwable {
assertThat(getMessages(), hasItems(
containsString("(CamelContext: camel-cdi) is starting"),
equalTo("Received message [Sample Message] from [Producer]"),
containsString("(CamelContext: camel-cdi) is shutdown")));
assertThat("Log messages not found!", getMessages(),
hasItems(
containsString("(CamelContext: camel-cdi) is starting"),
equalTo("Received message [Sample Message] from [Producer]"),
containsString("(CamelContext: camel-cdi) is shutdown"))
);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ public static Archive<?> deployment() {
public static TestRule verifier = new LogVerifier() {
@Override
protected void verify() throws Throwable {
assertThat(getMessages(), hasItems(
containsString("(CamelContext: camel-cdi) is starting"),
startsWith("Date is"),
containsString("(CamelContext: camel-cdi) is shutdown")));
assertThat("Log messages not found!", getMessages(),
hasItems(
containsString("(CamelContext: camel-cdi) is starting"),
startsWith("Date is"),
containsString("(CamelContext: camel-cdi) is shutdown"))
);
}
};

Expand Down

0 comments on commit 9246568

Please sign in to comment.