package net.kencochrane.raven.log4j2;

import net.kencochrane.raven.stub.SentryStub;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

public class SentryAppenderIT {
    private static final Logger logger = LogManager.getLogger(SentryAppenderIT.class);
    private SentryStub sentryStub;

    @Before
    public void setUp() {
        sentryStub = new SentryStub();
        sentryStub.removeEvents();
    }

    @After
    public void tearDown() {
        sentryStub.removeEvents();
    }

    @Test
    public void testInfoLog() {
        assertThat(sentryStub.getEventCount(), is(0));
        logger.info("This is a test");
        assertThat(sentryStub.getEventCount(), is(1));
    }

    @Test
    public void testChainedExceptions() {
        assertThat(sentryStub.getEventCount(), is(0));
        logger.error("This is an exception",
                new UnsupportedOperationException("Test", new UnsupportedOperationException()));
        assertThat(sentryStub.getEventCount(), is(1));
    }
}

@@ -177,44 +177,82 @@
 org.
-junit.After;%0Aimport org.junit
+testng.annotations.AfterMethod;%0Aimport org.testng.annotations
 .Before
+Method
 ;%0Aim
@@ -264,13 +264,26 @@
 org.
-junit
+testng.annotations
 .Tes
@@ -546,16 +546,22 @@
  @Before
+Method
 %0A    pub
@@ -670,16 +670,22 @@
   @After
+Method
 %0A    pub

Convert integration tests to testng