// Path: src/main/java/com/codereligion/bugsnag/logback/model/NotificationVO.java
// public class NotificationVO {
// 
//     /**
//      * The api key associated with the project. Informs bugsnag which project has generated this error.
//      */
//     private String apiKey;
// 
//     /**
//      * This object describes the notifier itself. These properties are used
//      * within bugsnag to track error rates from a notifier.
//      */
//     private NotifierVO notifier = new NotifierVO();
// 
//     /**
//      * A list of error events that bugsnag should be notified of. In the current version of his notifier
//      * the list will contain only one event.
//      */
//     private List<EventVO> events = Lists.newArrayList();
// 
//     public String getApiKey() {
//         return apiKey;
//     }
// 
//     public void setApiKey(final String apiKey) {
//         this.apiKey = apiKey;
//     }
// 
//     public List<EventVO> getEvents() {
//         return events;
//     }
// 
//     public void addEvents(final List<EventVO> events) {
//         this.events.addAll(events);
//     }
// 
//     public NotifierVO getNotifier() {
//         return notifier;
//     }
// }
// 
// Path: src/test/java/com/codereligion/bugsnag/logback/mock/logging/MockLoggingEvent.java
// public static MockLoggingEvent createLoggingEvent() {
//     return new MockLoggingEvent();
// }
// 
// Path: src/test/java/com/codereligion/bugsnag/logback/mock/logging/MockThrowableProxy.java
// public static MockThrowableProxy createThrowableProxy() {
//     return new MockThrowableProxy();
// }


import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import com.codereligion.bugsnag.logback.model.NotificationVO;
import com.google.common.collect.Sets;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import static com.codereligion.bugsnag.logback.mock.logging.MockLoggingEvent.createLoggingEvent;
import static com.codereligion.bugsnag.logback.mock.logging.MockThrowableProxy.createThrowableProxy;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
        when(configuration.isInvalid()).thenReturn(Boolean.FALSE);

        // when
        appender.start();
        appender.stop();

        // then
        verify(sender).stop();
        assertThat(appender.isStarted(), is(Boolean.FALSE));
    }

    @Test
    public void doesNotAppendWhenNotStarted() {

        appender.append(createLoggingEvent().with(createThrowableProxy()));

        verifyZeroInteractions(sender);
    }

    @Test
    public void doesNotAppendWhenStageIsIgnored() {

        // given
        when(configuration.isStageIgnored()).thenReturn(Boolean.TRUE);

        // when
        appender.start();
        appender.append(createLoggingEvent().with(createThrowableProxy()));

        // then
// Path: src/main/java/com/codereligion/bugsnag/logback/model/NotificationVO.java
// public class NotificationVO {
// 
//     /**
//      * The api key associated with the project. Informs bugsnag which project has generated this error.
//      */
//     private String apiKey;
// 
//     /**
//      * This object describes the notifier itself. These properties are used
//      * within bugsnag to track error rates from a notifier.
//      */
//     private NotifierVO notifier = new NotifierVO();
// 
//     /**
//      * A list of error events that bugsnag should be notified of. In the current version of his notifier
//      * the list will contain only one event.
//      */
//     private List<EventVO> events = Lists.newArrayList();
// 
//     public String getApiKey() {
//         return apiKey;
//     }
// 
//     public void setApiKey(final String apiKey) {
//         this.apiKey = apiKey;
//     }
// 
//     public List<EventVO> getEvents() {
//         return events;
//     }
// 
//     public void addEvents(final List<EventVO> events) {
//         this.events.addAll(events);
//     }
// 
//     public NotifierVO getNotifier() {
//         return notifier;
//     }
// }
// 
// Path: src/test/java/com/codereligion/bugsnag/logback/mock/logging/MockLoggingEvent.java
// public static MockLoggingEvent createLoggingEvent() {
//     return new MockLoggingEvent();
// }
// 
// Path: src/test/java/com/codereligion/bugsnag/logback/mock/logging/MockThrowableProxy.java
// public static MockThrowableProxy createThrowableProxy() {
//     return new MockThrowableProxy();
// }


// Path: src/test/java/com/codereligion/bugsnag/logback/AppenderTest.java
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import com.codereligion.bugsnag.logback.model.NotificationVO;
import com.google.common.collect.Sets;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import static com.codereligion.bugsnag.logback.mock.logging.MockLoggingEvent.createLoggingEvent;
import static com.codereligion.bugsnag.logback.mock.logging.MockThrowableProxy.createThrowableProxy;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;

        when(configuration.isInvalid()).thenReturn(Boolean.FALSE);

        // when
        appender.start();
        appender.stop();

        // then
        verify(sender).stop();
        assertThat(appender.isStarted(), is(Boolean.FALSE));
    }

    @Test
    public void doesNotAppendWhenNotStarted() {

        appender.append(createLoggingEvent().with(createThrowableProxy()));

        verifyZeroInteractions(sender);
    }

    @Test
    public void doesNotAppendWhenStageIsIgnored() {

        // given
        when(configuration.isStageIgnored()).thenReturn(Boolean.TRUE);

        // when
        appender.start();
        appender.append(createLoggingEvent().with(createThrowableProxy()));

        // then
        verify(sender, never()).send(any(NotificationVO.class));