.
does not match newline unless you specify Pattern.DOTALL
flag or (?s)
inside the pattern.
Change as follow:
assertThat(Log.getCachedLog()).matches("(?s).*bar.*");
But if you want just check bar
is contained in the log, contains
seems more appropriate:
assertThat(Log.getCachedLog()).contains("bar");