SpringBoot如何集成JUnit

SpringBoot如何集成JUnit

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
@RunWith(SpringRunner.class)
@SpringBootTest
public class XXXServiceTest {
@Autowired
private XXXService xxxService;
@Test
public void test1() {
}
}
@RunWith(SpringRunner.class) @SpringBootTest public class XXXServiceTest { @Autowired private XXXService xxxService; @Test public void test1() { } }
@RunWith(SpringRunner.class)
@SpringBootTest
public class XXXServiceTest {

    @Autowired
    private XXXService xxxService;

    @Test
    public void test1() {
    }
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *