0

I'm learning TDD in Java. I made a simple following test class:-

   public class EnrollingServiceTest extends TestCase {
        private EnrollingService enrollingService;

        public EnrollingServiceTest( String testName )
        {
            super( testName );
        }

        @Before
        public void init() {
            enrollingService = new EnrollingService();
        }

        @Test
        public void testEnroll() {
            boolean result = enrollingService.enroll(1l, 1l);
            assertTrue(result);
        }
    }

I put a break point to debug test execution. I found init() is never called. First called the constructor and then call goes to testEnroll(). Why @Before isn't called by the Junit framwork?

masiboo
  • 4,537
  • 9
  • 75
  • 136

0 Answers0