Kaynağa Gözat

Some tests added

Lauren Green 6 yıl önce
ebeveyn
işleme
d75eec3d2b

+ 11
- 3
src/test/java/com/example/demo/BakeryApplicationTests.java Dosyayı Görüntüle

@@ -1,9 +1,11 @@
1 1
 package com.example.demo;
2 2
 
3
-import org.apache.catalina.core.ApplicationContext;
3
+import com.example.demo.Controllers.BakerController;
4
+import com.example.demo.Controllers.MuffinController;
4 5
 import org.junit.Assert;
5 6
 import org.junit.Test;
6 7
 import org.junit.runner.RunWith;
8
+import org.springframework.beans.factory.annotation.Autowired;
7 9
 import org.springframework.boot.test.context.SpringBootTest;
8 10
 import org.springframework.test.context.junit4.SpringRunner;
9 11
 
@@ -11,11 +13,17 @@ import org.springframework.test.context.junit4.SpringRunner;
11 13
 @SpringBootTest
12 14
 public class BakeryApplicationTests {
13 15
 
14
-    private ApplicationContext applicationContext;
16
+    @Autowired
17
+    private BakerController bakerController;
18
+
19
+    @Autowired
20
+    private MuffinController muffinController;
21
+
15 22
 
16 23
     @Test
17 24
     public void contextLoads() {
18
-//        Assert.assertNull(applicationContext.);
25
+        Assert.assertNotNull(bakerController);
26
+        Assert.assertNotNull(muffinController);
19 27
     }
20 28
 
21 29
 }