1818import com .tencent .trpc .spring .boot .starters .test .HelloRequestProtocol .HelloRequest ;
1919import com .tencent .trpc .spring .boot .starters .test .HelloRequestProtocol .HelloResponse ;
2020import com .tencent .trpc .spring .boot .starters .test .SpringBootTestApplication ;
21- import javax .annotation .Resource ;
22- import org .junit .Assert ;
23- import org .junit .Test ;
24- import org .junit .runner .RunWith ;
21+ import jakarta .annotation .Resource ;
22+ import org .junit .jupiter .api .Assertions ;
23+ import org .junit .jupiter .api .Test ;
2524import org .springframework .beans .factory .annotation .Autowired ;
2625import org .springframework .boot .test .context .SpringBootTest ;
2726import org .springframework .boot .test .context .SpringBootTest .WebEnvironment ;
2827import org .springframework .context .annotation .ComponentScan ;
2928import org .springframework .context .annotation .Configuration ;
3029import org .springframework .test .context .ContextConfiguration ;
31- import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
3230
33- @ RunWith (SpringJUnit4ClassRunner .class )
3431@ SpringBootTest (classes = SpringBootTestApplication .class , webEnvironment = WebEnvironment .NONE )
3532@ ContextConfiguration (classes = EnableAnnotationTestConfiguration .class )
3633public class EnableAnnotationTest {
@@ -45,25 +42,25 @@ public void contextLoad() {
4542
4643 HelloResponse hello = demoService .sayHello (HelloRequest .newBuilder ().setMessage ("hello" ).build ());
4744
48- Assert .assertEquals ("hello" , hello .getMessage ());
49- Assert .assertNotNull (demoService .getGreeterService1Bean ());
50- Assert .assertNotNull (demoService .getGreeterService2Bean ());
51- Assert .assertNotNull (demoService .getMyTestServer ());
52- Assert .assertSame (demoService .getGreeterService (), demoService .getGreeterService1Bean ());
53- Assert .assertSame (demoService .getGreeterService2 (), demoService .getGreeterService2Bean ());
54- Assert .assertSame (demoService .getMyTestServerClient (), demoService .getMyTestServer ());
45+ Assertions .assertEquals ("hello" , hello .getMessage ());
46+ Assertions .assertNotNull (demoService .getGreeterService1Bean ());
47+ Assertions .assertNotNull (demoService .getGreeterService2Bean ());
48+ Assertions .assertNotNull (demoService .getMyTestServer ());
49+ Assertions .assertSame (demoService .getGreeterService (), demoService .getGreeterService1Bean ());
50+ Assertions .assertSame (demoService .getGreeterService2 (), demoService .getGreeterService2Bean ());
51+ Assertions .assertSame (demoService .getMyTestServerClient (), demoService .getMyTestServer ());
5552 }
5653
5754 @ Test
5855 public void testFilterInject () {
5956 AutoInjectTestFilter filter = (AutoInjectTestFilter ) FilterManager .get ("auto_inject_test_filter" );
60- Assert .assertSame (filter , autoInjectTestFilter );
61- Assert .assertNotNull (filter .getGreeterService ());
62- Assert .assertNotNull (filter .getGreeterService2 ());
63- Assert .assertNotNull (filter .getMyTestServer ());
64- Assert .assertSame (filter .getGreeterService (), demoService .getGreeterService1Bean ());
65- Assert .assertSame (filter .getGreeterService2 (), demoService .getGreeterService2Bean ());
66- Assert .assertSame (filter .getMyTestServer (), demoService .getMyTestServer ());
57+ Assertions .assertSame (filter , autoInjectTestFilter );
58+ Assertions .assertNotNull (filter .getGreeterService ());
59+ Assertions .assertNotNull (filter .getGreeterService2 ());
60+ Assertions .assertNotNull (filter .getMyTestServer ());
61+ Assertions .assertSame (filter .getGreeterService (), demoService .getGreeterService1Bean ());
62+ Assertions .assertSame (filter .getGreeterService2 (), demoService .getGreeterService2Bean ());
63+ Assertions .assertSame (filter .getMyTestServer (), demoService .getMyTestServer ());
6764 }
6865
6966 @ Configuration
0 commit comments