Test cases in inner classes with JUnit

前端 未结 5 617
故里飘歌
故里飘歌 2020-12-02 12:09

I read about Structuring Unit Tests with having a test class per class and an inner class per method. Figured that seemed like a handy way to organize the tests, so I tried

5条回答
  •  再見小時候
    2020-12-02 12:29

    public class ServicesTest extends TestBase {
    
       public static class TestLogon{
    
           @Test
           public void testLogonRequest() throws Exception {
             //My Test Code
           }
       }
    }
    

    Making the inner class static works for me.

提交回复
热议问题