|
@@ -0,0 +1,21 @@
|
|
1
|
+import com.Config.SpringConfiguration;
|
|
2
|
+import com.service.StudentService;
|
|
3
|
+import org.junit.Test;
|
|
4
|
+import org.junit.runner.RunWith;
|
|
5
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
6
|
+import org.springframework.test.context.ContextConfiguration;
|
|
7
|
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
8
|
+
|
|
9
|
+@RunWith(SpringJUnit4ClassRunner.class)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+@ContextConfiguration(classes = {SpringConfiguration.class})
|
|
14
|
+public class SpringJunitTest {
|
|
15
|
+ @Autowired
|
|
16
|
+ private StudentService service;
|
|
17
|
+ @Test
|
|
18
|
+ public void test1() {
|
|
19
|
+ service.showStudent();
|
|
20
|
+ }
|
|
21
|
+}
|