package dk.bitcraft.lc;

import org.junit.Rule;
import org.junit.Test;

import java.util.List;
import java.util.logging.Logger;

import static org.assertj.core.api.Assertions.assertThat;

public class JavaUtilLoggingTest {
    @Rule
    public LogCollector collector = new LogCollector(Logger.getLogger("test.logger"));

    @Test
    public void test() {
        {
            Logger log = Logger.getLogger("test.logger");
            log.warning("This is an warning!");
            log.warning("This is another warning!");
        }

        assertThat(collector.getLogs()).hasSize(2);
        List<String> logs = collector.getLogs();

        assertThat(logs.get(0)).contains("This is an warning!");
        assertThat(logs.get(1)).contains("This is another warning!");
    }
}

@@ -88,16 +88,84 @@
 l.List;%0A
+import java.util.logging.Level;%0Aimport java.util.logging.LogRecord;%0A
 import j
@@ -247,16 +247,59 @@
 ertThat;
+%0Aimport static org.junit.Assert.assertTrue;
 %0A%0Apublic
@@ -872,21 +872,181 @@
  warning!%22);
+%0A%0A        List%3CLogRecord%3E rawLogs = (List%3CLogRecord%3E) collector.getRawLogs();%0A        assertTrue(rawLogs.stream().allMatch(e -%3E e.getLevel() == Level.WARNING));
 %0A    %7D%0A%7D%0A

Add a simple JUL test.