ソースを参照

changed around some classes and added new packages

William Simkins 6 年 前
コミット
4dc81f0a68
共有32 個のファイルを変更した303 個の追加90 個の削除を含む
  1. 3
    3
      .gitignore
  2. 13
    0
      derby.log
  3. 33
    17
      pom.xml
  4. 0
    11
      src/main/java/Controllers/TopicsController.java
  5. 0
    20
      src/main/java/Controllers/User.java
  6. 0
    14
      src/main/java/Model/NewAccountCreator.java
  7. 2
    4
      src/main/java/com/tyler/motivateme/Forum.java
  8. 2
    4
      src/main/java/com/tyler/motivateme/Inbox.java
  9. 1
    1
      src/main/java/com/tyler/motivateme/MainApplication.java
  10. 1
    1
      src/main/java/com/tyler/motivateme/MainTopicsPage.java
  11. 2
    6
      src/main/java/com/tyler/motivateme/TopicInfoPage.java
  12. 3
    1
      src/main/java/com/tyler/motivateme/controller/CommentController.java
  13. 4
    2
      src/main/java/com/tyler/motivateme/controller/MessageController.java
  14. 24
    0
      src/main/java/com/tyler/motivateme/controller/NewTopicCreatorController.java
  15. 13
    0
      src/main/java/com/tyler/motivateme/controller/TestController1.java
  16. 13
    0
      src/main/java/com/tyler/motivateme/controller/TopicsController.java
  17. 1
    1
      src/main/java/com/tyler/motivateme/model/Console.java
  18. 3
    5
      src/main/java/com/tyler/motivateme/model/NewTopicCreator.java
  19. 18
    0
      src/main/java/com/tyler/motivateme/model/NewTopicCreatorService.java
  20. 35
    0
      src/main/java/com/tyler/motivateme/model/Topic.java
  21. 68
    0
      src/main/java/com/tyler/motivateme/model/User.java
  22. 9
    0
      src/main/java/com/tyler/motivateme/repository/UserRepository.java
  23. 3
    0
      src/main/resources/application.properties
  24. 5
    0
      src/test/java/Controllers/CommentControllerTest.java
  25. 6
    0
      src/test/java/Controllers/MessageControllerTest.java
  26. 6
    0
      src/test/java/Model/ConsoleTest.java
  27. 10
    0
      src/test/java/Model/NewAccountCreatorTest.java
  28. 5
    0
      src/test/java/Model/NewTopicCreatorTest.java
  29. 5
    0
      src/test/java/View/ForumTest.java
  30. 5
    0
      src/test/java/View/InboxTest.java
  31. 5
    0
      src/test/java/View/MainTopicsPageTest.java
  32. 5
    0
      src/test/java/View/TopicInfoPageTest.java

+ 3
- 3
.gitignore ファイルの表示

@@ -1,7 +1,7 @@
1 1
 # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
2 2
 # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
3 3
 
4
-# Controllers.User-specific stuff:
4
+# Controllers.com.tyler.motivateme.model.User-specific stuff:
5 5
 .idea/**/workspace.xml
6 6
 .idea/**/tasks.xml
7 7
 .idea/dictionaries
@@ -38,7 +38,7 @@ cmake-build-debug/
38 38
 # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
39 39
 # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
40 40
 
41
-# Controllers.User-specific stuff:
41
+# Controllers.com.tyler.motivateme.model.User-specific stuff:
42 42
 *.iml
43 43
 .idea/**
44 44
 .idea/**/workspace.xml
@@ -88,7 +88,7 @@ crashlytics-build.properties
88 88
 fabric.properties# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
89 89
                  # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
90 90
 
91
-                 # Controllers.User-specific stuff:
91
+                 # Controllers.com.tyler.motivateme.model.User-specific stuff:
92 92
                  .idea/**/workspace.xml
93 93
                  .idea/**/tasks.xml
94 94
                  .idea/dictionaries

+ 13
- 0
derby.log ファイルの表示

@@ -0,0 +1,13 @@
1
+----------------------------------------------------------------
2
+Fri Jul 13 10:24:59 EDT 2018:
3
+Booting Derby version The Apache Software Foundation - Apache Derby - 10.14.1.0 - (1808820): instance a816c00e-0164-9407-d674-0000039a2310 
4
+on database directory memory:/Users/williams/Labs/ZCW-SpringOne/motivateme/testdb with class loader sun.misc.Launcher$AppClassLoader@18b4aac2 
5
+Loaded from file:/Users/williams/.m2/repository/org/apache/derby/derby/10.14.1.0/derby-10.14.1.0.jar
6
+java.vendor=Oracle Corporation
7
+java.runtime.version=1.8.0_172-b11
8
+user.dir=/Users/williams/Labs/ZCW-SpringOne/motivateme
9
+os.name=Mac OS X
10
+os.arch=x86_64
11
+os.version=10.13.4
12
+derby.system.home=null
13
+Database Class Loader started - derby.database.classpath=''

+ 33
- 17
pom.xml ファイルの表示

@@ -1,44 +1,59 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<project xmlns="http://maven.apache.org/POM/4.0.0"
3
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 3
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5 4
     <modelVersion>4.0.0</modelVersion>
6 5
 
7 6
     <groupId>com.tyler</groupId>
8 7
     <artifactId>motivateme</artifactId>
9
-    <version>1.0-SNAPSHOT</version>
8
+    <version>0.0.1-SNAPSHOT</version>
9
+    <packaging>jar</packaging>
10
+
11
+    <name>motivateme</name>
12
+    <description>Demo project for Spring Boot</description>
10 13
 
11 14
     <parent>
12 15
         <groupId>org.springframework.boot</groupId>
13 16
         <artifactId>spring-boot-starter-parent</artifactId>
14 17
         <version>2.0.3.RELEASE</version>
18
+        <relativePath/> <!-- lookup parent from repository -->
15 19
     </parent>
16 20
 
21
+    <properties>
22
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24
+        <java.version>1.8</java.version>
25
+    </properties>
26
+
17 27
     <dependencies>
18 28
         <dependency>
19 29
             <groupId>org.springframework.boot</groupId>
30
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
31
+        </dependency>
32
+        <dependency>
33
+            <groupId>org.springframework.boot</groupId>
34
+            <artifactId>spring-boot-starter-data-rest</artifactId>
35
+        </dependency>
36
+        <dependency>
37
+            <groupId>org.springframework.boot</groupId>
38
+            <artifactId>spring-boot-starter-hateoas</artifactId>
39
+        </dependency>
40
+        <dependency>
41
+            <groupId>org.springframework.boot</groupId>
20 42
             <artifactId>spring-boot-starter-web</artifactId>
21 43
         </dependency>
22 44
 
23 45
         <dependency>
24
-            <groupId>junit</groupId>
25
-            <artifactId>junit</artifactId>
26
-            <version>RELEASE</version>
27
-            <scope>test</scope>
46
+            <groupId>mysql</groupId>
47
+            <artifactId>mysql-connector-java</artifactId>
48
+            <scope>runtime</scope>
28 49
         </dependency>
29
-
30 50
         <dependency>
31
-            <groupId>net.anthavio.disquo</groupId>
32
-            <artifactId>disquo-api</artifactId>
33
-            <version>1.0.2</version>
51
+            <groupId>org.springframework.boot</groupId>
52
+            <artifactId>spring-boot-starter-test</artifactId>
53
+            <scope>test</scope>
34 54
         </dependency>
35 55
     </dependencies>
36 56
 
37
-    <properties>
38
-        <java.version>1.8</java.version>
39
-    </properties>
40
-
41
-
42 57
     <build>
43 58
         <plugins>
44 59
             <plugin>
@@ -48,4 +63,5 @@
48 63
         </plugins>
49 64
     </build>
50 65
 
51
-</project>
66
+
67
+</project>

+ 0
- 11
src/main/java/Controllers/TopicsController.java ファイルの表示

@@ -1,11 +0,0 @@
1
-package Controllers;
2
-
3
-import org.springframework.web.bind.annotation.RestController;
4
-
5
-@RestController
6
-public interface TopicsController {
7
-
8
-    public String getDescription();
9
-    public String getAdviceAndStrategies();
10
-
11
-}

+ 0
- 20
src/main/java/Controllers/User.java ファイルの表示

@@ -1,20 +0,0 @@
1
-package Controllers;
2
-
3
-import org.springframework.web.bind.annotation.RestController;
4
-
5
-@RestController
6
-public abstract class User {
7
-    private int id;
8
-    private String name;
9
-    private String username;
10
-    private String password;
11
-    private String email;
12
-
13
-    public User(int id, String name, String username, String password, String email){
14
-        this.id = id;
15
-        this.name = name;
16
-        this.username = username;
17
-        this.password = password;
18
-        this.email = email;
19
-    }
20
-}

+ 0
- 14
src/main/java/Model/NewAccountCreator.java ファイルの表示

@@ -1,14 +0,0 @@
1
-package Model;
2
-
3
-import Controllers.User;
4
-
5
-public class NewAccountCreator extends User {
6
-
7
-    public NewAccountCreator(int id, String name, String username, String password, String email) {
8
-        super(id, name, username, password, email);
9
-    }
10
-
11
-    public User createUser(){
12
-        return null;
13
-    }
14
-}

src/main/java/View/Forum.java → src/main/java/com/tyler/motivateme/Forum.java ファイルの表示

@@ -1,8 +1,6 @@
1
-package View;
1
+package com.tyler.motivateme;
2 2
 
3
-import Controllers.CommentController;
4
-
5
-public class Forum extends CommentController {
3
+public class Forum {
6 4
     private int forumId;
7 5
 
8 6
     public Forum(int forumId) {

src/main/java/View/Inbox.java → src/main/java/com/tyler/motivateme/Inbox.java ファイルの表示

@@ -1,8 +1,6 @@
1
-package View;
1
+package com.tyler.motivateme;
2 2
 
3
-import Controllers.MessageController;
4
-
5
-public class Inbox extends MessageController {
3
+public class Inbox {
6 4
     private int id;
7 5
 
8 6
     public Inbox(int id){

src/main/java/View/MainApplication.java → src/main/java/com/tyler/motivateme/MainApplication.java ファイルの表示

@@ -1,4 +1,4 @@
1
-package View;
1
+package com.tyler.motivateme;
2 2
 
3 3
 import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;

src/main/java/View/MainTopicsPage.java → src/main/java/com/tyler/motivateme/MainTopicsPage.java ファイルの表示

@@ -1,4 +1,4 @@
1
-package View;
1
+package com.tyler.motivateme;
2 2
 
3 3
 import java.util.ArrayList;
4 4
 import java.util.List;

src/main/java/Model/NewTopicCreator.java → src/main/java/com/tyler/motivateme/TopicInfoPage.java ファイルの表示

@@ -1,15 +1,11 @@
1
-package Model;
1
+package com.tyler.motivateme;
2 2
 
3
-import Controllers.TopicsController;
3
+public class TopicInfoPage{
4 4
 
5
-public class NewTopicCreator implements TopicsController {
6
-
7
-    @Override
8 5
     public String getDescription() {
9 6
         return null;
10 7
     }
11 8
 
12
-    @Override
13 9
     public String getAdviceAndStrategies() {
14 10
         return null;
15 11
     }

src/main/java/Controllers/CommentController.java → src/main/java/com/tyler/motivateme/controller/CommentController.java ファイルの表示

@@ -1,8 +1,10 @@
1
-package Controllers;
1
+package com.tyler.motivateme.controller;
2 2
 
3
+import org.springframework.web.bind.annotation.RequestMapping;
3 4
 import org.springframework.web.bind.annotation.RestController;
4 5
 
5 6
 @RestController
7
+@RequestMapping("/comments")
6 8
 public class CommentController {
7 9
 
8 10
     public String postComment(int id){

src/main/java/Controllers/MessageController.java → src/main/java/com/tyler/motivateme/controller/MessageController.java ファイルの表示

@@ -1,11 +1,13 @@
1
-package Controllers;
1
+package com.tyler.motivateme.controller;
2 2
 
3
+import org.springframework.web.bind.annotation.RequestMapping;
3 4
 import org.springframework.web.bind.annotation.RestController;
4 5
 
5 6
 @RestController
7
+@RequestMapping("/messages")
6 8
 public class MessageController {
7 9
 
8 10
     public String sendMessage(int id){
9 11
         return null;
10 12
     }
11
-}
13
+}

+ 24
- 0
src/main/java/com/tyler/motivateme/controller/NewTopicCreatorController.java ファイルの表示

@@ -0,0 +1,24 @@
1
+package com.tyler.motivateme.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+
6
+@RestController
7
+public class NewTopicCreatorController {
8
+
9
+//    @Autowired
10
+//    private NewTopicCreatorService newTopicCreatorService;
11
+//
12
+//    @RequestMapping(path="/topics")
13
+//    public List<Topic> allTopics() {
14
+//
15
+//        return newTopicCreatorService.allTopics();
16
+//    }
17
+
18
+    @RequestMapping(value="/api/topics")
19
+    public String what(){
20
+        return "topic";
21
+    }
22
+
23
+
24
+}

+ 13
- 0
src/main/java/com/tyler/motivateme/controller/TestController1.java ファイルの表示

@@ -0,0 +1,13 @@
1
+package com.tyler.motivateme.controller;
2
+
3
+import org.springframework.web.bind.annotation.GetMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+
6
+@RestController
7
+public class TestController1 {
8
+
9
+    @GetMapping(value = "/hello")
10
+    public String hello(){
11
+        return "world";
12
+    }
13
+}

+ 13
- 0
src/main/java/com/tyler/motivateme/controller/TopicsController.java ファイルの表示

@@ -0,0 +1,13 @@
1
+package com.tyler.motivateme.controller;
2
+
3
+import org.springframework.web.bind.annotation.RequestMapping;
4
+import org.springframework.web.bind.annotation.RestController;
5
+
6
+@RestController
7
+@RequestMapping("/mytopics")
8
+public class TopicsController {
9
+
10
+    public String getDescription() {return null;}
11
+    public String getAdviceAndStrategies() {return null;}
12
+
13
+}

src/main/java/Model/Console.java → src/main/java/com/tyler/motivateme/model/Console.java ファイルの表示

@@ -1,4 +1,4 @@
1
-package Model;
1
+package com.tyler.motivateme.model;
2 2
 
3 3
 public class Console {
4 4
 

src/main/java/View/TopicInfoPage.java → src/main/java/com/tyler/motivateme/model/NewTopicCreator.java ファイルの表示

@@ -1,15 +1,13 @@
1
-package View;
1
+package com.tyler.motivateme.model;
2 2
 
3
-import Controllers.TopicsController;
4 3
 
5
-public class TopicInfoPage implements TopicsController {
4
+public class NewTopicCreator{
6 5
 
7
-    @Override
8 6
     public String getDescription() {
7
+
9 8
         return null;
10 9
     }
11 10
 
12
-    @Override
13 11
     public String getAdviceAndStrategies() {
14 12
         return null;
15 13
     }

+ 18
- 0
src/main/java/com/tyler/motivateme/model/NewTopicCreatorService.java ファイルの表示

@@ -0,0 +1,18 @@
1
+package com.tyler.motivateme.model;
2
+
3
+import org.springframework.stereotype.Service;
4
+
5
+import java.util.ArrayList;
6
+import java.util.Arrays;
7
+import java.util.List;
8
+
9
+@Service
10
+public class NewTopicCreatorService {
11
+
12
+    private List<Topic> topics = new ArrayList<Topic>(Arrays.asList(new Topic(1, "Quit drinking"), new Topic(2, "Quit Smoking"), new Topic(3, "Eat healthier")));
13
+
14
+    public List<Topic> allTopics() {
15
+
16
+        return topics;
17
+    }
18
+}

+ 35
- 0
src/main/java/com/tyler/motivateme/model/Topic.java ファイルの表示

@@ -0,0 +1,35 @@
1
+package com.tyler.motivateme.model;
2
+
3
+import javax.persistence.GeneratedValue;
4
+import javax.persistence.GenerationType;
5
+import javax.persistence.Id;
6
+
7
+public class Topic {
8
+    @Id
9
+    @GeneratedValue(strategy = GenerationType.AUTO)
10
+    private int id;
11
+    private String name;
12
+
13
+    public Topic(int id, String name) {
14
+        this.id = id;
15
+        this.name = name;
16
+    }
17
+
18
+    public Topic(){};
19
+
20
+    public int getId() {
21
+        return id;
22
+    }
23
+
24
+    public void setId(int id) {
25
+        this.id = id;
26
+    }
27
+
28
+    public String getName() {
29
+        return name;
30
+    }
31
+
32
+    public void setName(String name) {
33
+        this.name = name;
34
+    }
35
+}

+ 68
- 0
src/main/java/com/tyler/motivateme/model/User.java ファイルの表示

@@ -0,0 +1,68 @@
1
+package com.tyler.motivateme.model;
2
+
3
+import javax.persistence.Entity;
4
+import javax.persistence.GeneratedValue;
5
+import javax.persistence.GenerationType;
6
+import javax.persistence.Id;
7
+
8
+@Entity
9
+public class User {
10
+    @Id
11
+    @GeneratedValue(strategy = GenerationType.AUTO)
12
+    private int id;
13
+
14
+    private String name;
15
+    private String username;
16
+    private String password;
17
+    private String email;
18
+
19
+    public User(){}
20
+
21
+    public User(int id, String name, String username, String password, String email){
22
+        this.id = id;
23
+        this.name = name;
24
+        this.username = username;
25
+        this.password = password;
26
+        this.email = email;
27
+    }
28
+
29
+    public int getId() {
30
+        return id;
31
+    }
32
+
33
+    public void setId(int id) {
34
+        this.id = id;
35
+    }
36
+
37
+    public String getName() {
38
+        return name;
39
+    }
40
+
41
+    public void setName(String name) {
42
+        this.name = name;
43
+    }
44
+
45
+    public String getUsername() {
46
+        return username;
47
+    }
48
+
49
+    public void setUsername(String username) {
50
+        this.username = username;
51
+    }
52
+
53
+    public String getPassword() {
54
+        return password;
55
+    }
56
+
57
+    public void setPassword(String password) {
58
+        this.password = password;
59
+    }
60
+
61
+    public String getEmail() {
62
+        return email;
63
+    }
64
+
65
+    public void setEmail(String email) {
66
+        this.email = email;
67
+    }
68
+}

+ 9
- 0
src/main/java/com/tyler/motivateme/repository/UserRepository.java ファイルの表示

@@ -0,0 +1,9 @@
1
+package com.tyler.motivateme.repository;
2
+
3
+import com.tyler.motivateme.model.User;
4
+import org.springframework.data.repository.CrudRepository;
5
+import org.springframework.stereotype.Repository;
6
+
7
+@Repository
8
+public interface UserRepository extends CrudRepository<User, Integer> {
9
+}

+ 3
- 0
src/main/resources/application.properties ファイルの表示

@@ -0,0 +1,3 @@
1
+spring.jpa.hibernate.ddl-auto=create-drop
2
+spring.datasource.url=jdbc:mysql://localhost:3306/demo1?useSSL=false
3
+spring.datasource.username=root

+ 5
- 0
src/test/java/Controllers/CommentControllerTest.java ファイルの表示

@@ -1,7 +1,12 @@
1 1
 package Controllers;
2 2
 
3 3
 import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
4 7
 
8
+@RunWith(SpringRunner.class)
9
+@SpringBootTest
5 10
 public class CommentControllerTest {
6 11
 
7 12
     @Test

+ 6
- 0
src/test/java/Controllers/MessageControllerTest.java ファイルの表示

@@ -1,7 +1,13 @@
1 1
 package Controllers;
2 2
 
3 3
 import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
4 7
 
8
+
9
+@RunWith(SpringRunner.class)
10
+@SpringBootTest
5 11
 public class MessageControllerTest {
6 12
 
7 13
     @Test

+ 6
- 0
src/test/java/Model/ConsoleTest.java ファイルの表示

@@ -1,7 +1,13 @@
1 1
 package Model;
2 2
 
3 3
 import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
4 7
 
8
+
9
+@RunWith(SpringRunner.class)
10
+@SpringBootTest
5 11
 public class ConsoleTest {
6 12
 
7 13
     @Test

+ 10
- 0
src/test/java/Model/NewAccountCreatorTest.java ファイルの表示

@@ -1,7 +1,17 @@
1 1
 package Model;
2 2
 
3
+import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
7
+
8
+@RunWith(SpringRunner.class)
9
+@SpringBootTest
3 10
 public class NewAccountCreatorTest {
4 11
 
12
+    @Test
13
+    public void testCreateUser() {
5 14
 
15
+    }
6 16
 
7 17
 }

+ 5
- 0
src/test/java/Model/NewTopicCreatorTest.java ファイルの表示

@@ -1,7 +1,12 @@
1 1
 package Model;
2 2
 
3 3
 import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
4 7
 
8
+@RunWith(SpringRunner.class)
9
+@SpringBootTest
5 10
 public class NewTopicCreatorTest {
6 11
 
7 12
     @Test

+ 5
- 0
src/test/java/View/ForumTest.java ファイルの表示

@@ -1,7 +1,12 @@
1 1
 package View;
2 2
 
3 3
 import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
4 7
 
8
+@RunWith(SpringRunner.class)
9
+@SpringBootTest
5 10
 public class ForumTest {
6 11
 
7 12
     @Test

+ 5
- 0
src/test/java/View/InboxTest.java ファイルの表示

@@ -1,7 +1,12 @@
1 1
 package View;
2 2
 
3 3
 import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
4 7
 
8
+@RunWith(SpringRunner.class)
9
+@SpringBootTest
5 10
 public class InboxTest {
6 11
 
7 12
     @Test

+ 5
- 0
src/test/java/View/MainTopicsPageTest.java ファイルの表示

@@ -1,7 +1,12 @@
1 1
 package View;
2 2
 
3 3
 import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
4 7
 
8
+@RunWith(SpringRunner.class)
9
+@SpringBootTest
5 10
 public class MainTopicsPageTest {
6 11
 
7 12
     @Test

+ 5
- 0
src/test/java/View/TopicInfoPageTest.java ファイルの表示

@@ -1,7 +1,12 @@
1 1
 package View;
2 2
 
3 3
 import org.junit.Test;
4
+import org.junit.runner.RunWith;
5
+import org.springframework.boot.test.context.SpringBootTest;
6
+import org.springframework.test.context.junit4.SpringRunner;
4 7
 
8
+@RunWith(SpringRunner.class)
9
+@SpringBootTest
5 10
 public class TopicInfoPageTest {
6 11
 
7 12
     @Test