// Path: jmock-junit5/src/test/java/org/jmock/junit5/testdata/jmock/acceptance/JUnit5WithRulesExamples.java
// public class JUnit5WithRulesExamples {
//     public static class SatisfiesExpectations {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
//         private final Runnable runnable = context.mock(Runnable.class);
// 
//         @Test
//         public void doesSatisfyExpectations() {
//             context.checking(new Expectations() {
//                 {
//                     oneOf(runnable).run();
//                 }
//             });
// 
//             runnable.run();
//         }
//     }
// 
//     public static class DoesNotSatisfyExpectations {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
//         private Runnable runnable = context.mock(Runnable.class);
// 
//         @Test
//         public void doesNotSatisfyExpectations() {
//             context.checking(new Expectations() {
//                 {
//                     oneOf(runnable).run();
//                 }
//             });
// 
//             // Return without satisfying the expectation for runnable.run()
//         }
//     }
// 
//     public static class DerivedAndDoesNotSatisfyExpectations extends BaseClassWithJMockContext {
//         private Runnable runnable = context.mock(Runnable.class);
// 
//         @Test
//         public void doesNotSatisfyExpectations() {
//             context.checking(new Expectations() {
//                 {
//                     oneOf(runnable).run();
//                 }
//             });
// 
//             // Return without satisfying the expectation for runnable.run()
//         }
//     }
// 
//     @ExtendWith(ExpectationExtension.class)
//     public static class ThrowsExpectedException {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
//         private WithException withException = context.mock(WithException.class);
// 
//         @Test
//         @ExpectationThrows(expected = CheckedException.class)
//         public void doesNotSatisfyExpectationsWhenExpectedExceptionIsThrown() throws CheckedException {
//             context.checking(new Expectations() {
//                 {
//                     oneOf(withException).anotherMethod();
//                     oneOf(withException).throwingMethod();
//                     will(throwException(new CheckedException()));
//                 }
//             });
// 
//             withException.throwingMethod();
//         }
// 
//         @SuppressWarnings("serial")
//         public static class CheckedException extends Exception {
//         }
// 
//         public interface WithException {
//             void throwingMethod() throws CheckedException;
// 
//             void anotherMethod();
//         }
//     }
// 
//     public static class CreatesTwoMockeries extends BaseClassWithJMockContext {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
// 
//         @Test
//         public void doesNothing() {
//             // no op
//         }
//     }
// 
//     public static class AutoInstantiatesMocks extends BaseClassWithJMockContext {
//         @Mock
//         Runnable runnable;
//         @Auto
//         States states;
//         @Auto
//         Sequence sequence;
// 
//         @Test
//         public void fieldsHaveBeenAutoInstantiated() {
//             assertThat("runnable", runnable, notNullValue());
//             assertThat("states", states, notNullValue());
//             assertThat("sequence", sequence, notNullValue());
//         }
//     }
// 
//     public static class BaseClassWithJMockContext {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
//     }
// 
// }


import org.jmock.junit5.testdata.jmock.acceptance.JUnit5WithRulesExamples;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtensionConfigurationException;
package org.jmock.junit5.acceptance;


public class JUnit5WithRulesTestRunnerTests {
    FailureRecordingTestExecutionListener listener = new FailureRecordingTestExecutionListener();
    
    @Test
    public void testTheJUnit4TestRunnerReportsPassingTestsAsSuccessful() {
        listener.runTestIn(JUnit5WithRulesExamples.SatisfiesExpectations.class);
        listener.assertTestSucceeded();
    }
    
    @Test
    public void testTheJUnit4TestRunnerAutomaticallyAssertsThatAllExpectationsHaveBeenSatisfied() {
        listener.runTestIn(JUnit5WithRulesExamples.DoesNotSatisfyExpectations.class);
        listener.assertTestFailedWith(AssertionError.class);
    }
    
    @Test
    public void testTheJUnit4TestRunnerLooksForTheMockeryInBaseClasses() {
        listener.runTestIn(JUnit5WithRulesExamples.DerivedAndDoesNotSatisfyExpectations.class);
        listener.assertTestFailedWith(AssertionError.class);
    }

    
    // See issue JMOCK-156
    @Test
    public void testReportsMocksAreNotSatisfiedWhenExpectedExceptionIsThrown() {
        listener.runTestIn(JUnit5WithRulesExamples.ThrowsExpectedException.class);
        listener.assertTestFailedWith(AssertionError.class);
    }
    
    @Test
// Path: jmock-junit5/src/test/java/org/jmock/junit5/testdata/jmock/acceptance/JUnit5WithRulesExamples.java
// public class JUnit5WithRulesExamples {
//     public static class SatisfiesExpectations {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
//         private final Runnable runnable = context.mock(Runnable.class);
// 
//         @Test
//         public void doesSatisfyExpectations() {
//             context.checking(new Expectations() {
//                 {
//                     oneOf(runnable).run();
//                 }
//             });
// 
//             runnable.run();
//         }
//     }
// 
//     public static class DoesNotSatisfyExpectations {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
//         private Runnable runnable = context.mock(Runnable.class);
// 
//         @Test
//         public void doesNotSatisfyExpectations() {
//             context.checking(new Expectations() {
//                 {
//                     oneOf(runnable).run();
//                 }
//             });
// 
//             // Return without satisfying the expectation for runnable.run()
//         }
//     }
// 
//     public static class DerivedAndDoesNotSatisfyExpectations extends BaseClassWithJMockContext {
//         private Runnable runnable = context.mock(Runnable.class);
// 
//         @Test
//         public void doesNotSatisfyExpectations() {
//             context.checking(new Expectations() {
//                 {
//                     oneOf(runnable).run();
//                 }
//             });
// 
//             // Return without satisfying the expectation for runnable.run()
//         }
//     }
// 
//     @ExtendWith(ExpectationExtension.class)
//     public static class ThrowsExpectedException {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
//         private WithException withException = context.mock(WithException.class);
// 
//         @Test
//         @ExpectationThrows(expected = CheckedException.class)
//         public void doesNotSatisfyExpectationsWhenExpectedExceptionIsThrown() throws CheckedException {
//             context.checking(new Expectations() {
//                 {
//                     oneOf(withException).anotherMethod();
//                     oneOf(withException).throwingMethod();
//                     will(throwException(new CheckedException()));
//                 }
//             });
// 
//             withException.throwingMethod();
//         }
// 
//         @SuppressWarnings("serial")
//         public static class CheckedException extends Exception {
//         }
// 
//         public interface WithException {
//             void throwingMethod() throws CheckedException;
// 
//             void anotherMethod();
//         }
//     }
// 
//     public static class CreatesTwoMockeries extends BaseClassWithJMockContext {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
// 
//         @Test
//         public void doesNothing() {
//             // no op
//         }
//     }
// 
//     public static class AutoInstantiatesMocks extends BaseClassWithJMockContext {
//         @Mock
//         Runnable runnable;
//         @Auto
//         States states;
//         @Auto
//         Sequence sequence;
// 
//         @Test
//         public void fieldsHaveBeenAutoInstantiated() {
//             assertThat("runnable", runnable, notNullValue());
//             assertThat("states", states, notNullValue());
//             assertThat("sequence", sequence, notNullValue());
//         }
//     }
// 
//     public static class BaseClassWithJMockContext {
//         @RegisterExtension
//         public final JUnit5Mockery context = new JUnit5Mockery();
//     }
// 
// }


// Path: jmock-junit5/src/test/java/org/jmock/junit5/acceptance/JUnit5WithRulesTestRunnerTests.java
import org.jmock.junit5.testdata.jmock.acceptance.JUnit5WithRulesExamples;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtensionConfigurationException;

package org.jmock.junit5.acceptance;


public class JUnit5WithRulesTestRunnerTests {
    FailureRecordingTestExecutionListener listener = new FailureRecordingTestExecutionListener();
    
    @Test
    public void testTheJUnit4TestRunnerReportsPassingTestsAsSuccessful() {
        listener.runTestIn(JUnit5WithRulesExamples.SatisfiesExpectations.class);
        listener.assertTestSucceeded();
    }
    
    @Test
    public void testTheJUnit4TestRunnerAutomaticallyAssertsThatAllExpectationsHaveBeenSatisfied() {
        listener.runTestIn(JUnit5WithRulesExamples.DoesNotSatisfyExpectations.class);
        listener.assertTestFailedWith(AssertionError.class);
    }
    
    @Test
    public void testTheJUnit4TestRunnerLooksForTheMockeryInBaseClasses() {
        listener.runTestIn(JUnit5WithRulesExamples.DerivedAndDoesNotSatisfyExpectations.class);
        listener.assertTestFailedWith(AssertionError.class);
    }

    
    // See issue JMOCK-156
    @Test
    public void testReportsMocksAreNotSatisfiedWhenExpectedExceptionIsThrown() {
        listener.runTestIn(JUnit5WithRulesExamples.ThrowsExpectedException.class);
        listener.assertTestFailedWith(AssertionError.class);
    }
    
    @Test
    public void testFailsWhenMoreThanOneJMockContextField() {