Skip to content

Commit

Permalink
Assert relative ordering of log messages in samples
Browse files Browse the repository at this point in the history
  • Loading branch information
astefanutti committed Jan 12, 2016
1 parent 3d2636f commit 4e4049f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import org.junit.rules.TestRule;
import org.junit.runner.RunWith;

import static org.hamcrest.Matchers.containsInRelativeOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.junit.Assert.assertThat;

@RunWith(Arquillian.class)
Expand All @@ -53,7 +53,7 @@ public static Archive<?> deployment() {
@Override
protected void verify() throws Throwable {
assertThat("Log messages not found!", getMessages(),
hasItems(
containsInRelativeOrder(
containsString("(CamelContext: camel-1) is starting"),
equalTo("Hello from CamelContext(camel-1)"),
containsString("(CamelContext: camel-1) is shutdown"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

import java.util.Locale;

import static org.hamcrest.Matchers.containsInRelativeOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.junit.Assert.assertThat;

@RunWith(Arquillian.class)
Expand Down Expand Up @@ -72,7 +72,7 @@ protected void after() {
@Override
protected void verify() throws Throwable {
assertThat("Log messages not found!", getMessages(),
hasItems(
containsInRelativeOrder(
containsString("(CamelContext: camel-1) is starting"),
equalTo("Bonjour de CamelContext(camel-1)"),
containsString("(CamelContext: camel-1) is shutdown"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import org.junit.rules.TestRule;
import org.junit.runner.RunWith;

import static org.hamcrest.Matchers.containsInRelativeOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.junit.Assert.assertThat;

@RunWith(Arquillian.class)
Expand All @@ -53,7 +53,7 @@ public static Archive<?> deployment() {
@Override
protected void verify() throws Throwable {
assertThat("Log messages not found!", getMessages(),
hasItems(
containsInRelativeOrder(
containsString("(CamelContext: camel-1) is starting"),
equalTo("Received message [Sample Message] from [Producer]"),
containsString("(CamelContext: camel-1) is shutdown"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import org.junit.rules.TestRule;
import org.junit.runner.RunWith;

import static org.hamcrest.Matchers.containsInRelativeOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertThat;
Expand All @@ -57,7 +57,7 @@ public static Archive<?> deployment() {
@Override
protected void verify() throws Throwable {
assertThat("Log messages not found!", getMessages(),
hasItems(
containsInRelativeOrder(
containsString("(CamelContext: camel-1) is starting"),
startsWith("Date is"),
containsString("(CamelContext: camel-1) is shutdown"))
Expand Down

0 comments on commit 4e4049f

Please sign in to comment.