1.輸入依存度
<依存> <groupIdを> org.springframework.boot </ groupIdを> <たartifactId>ばねブートスタータ試験</たartifactId> <スコープ>テスト</スコープ> </依存関係>
2.アイデア自動的にテストクラスを作成するために、あなたはまた、独自のマニュアルを作成することができます
3.テストクラスを書きます
@RunWith(SpringRunner.class) @SpringBootTest パブリッククラスTestImpl2Test { @Autowired @Qualifier( "testImpl2") ITestServer iTestServer; @テスト 公共ボイド試験(){ iTestServer.showClassName(); } }