Bladeren bron

changed around some classes and added new packages

William Simkins 6 jaren geleden
bovenliggende
commit
4dc81f0a68
32 gewijzigde bestanden met toevoegingen van 303 en 90 verwijderingen
  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 Bestand weergeven

1
 # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
1
 # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
2
 # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
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
 .idea/**/workspace.xml
5
 .idea/**/workspace.xml
6
 .idea/**/tasks.xml
6
 .idea/**/tasks.xml
7
 .idea/dictionaries
7
 .idea/dictionaries
38
 # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
38
 # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
39
 # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
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
 *.iml
42
 *.iml
43
 .idea/**
43
 .idea/**
44
 .idea/**/workspace.xml
44
 .idea/**/workspace.xml
88
 fabric.properties# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
88
 fabric.properties# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
89
                  # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
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
                  .idea/**/workspace.xml
92
                  .idea/**/workspace.xml
93
                  .idea/**/tasks.xml
93
                  .idea/**/tasks.xml
94
                  .idea/dictionaries
94
                  .idea/dictionaries

+ 13
- 0
derby.log Bestand weergeven

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 Bestand weergeven

1
 <?xml version="1.0" encoding="UTF-8"?>
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
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
     <modelVersion>4.0.0</modelVersion>
4
     <modelVersion>4.0.0</modelVersion>
6
 
5
 
7
     <groupId>com.tyler</groupId>
6
     <groupId>com.tyler</groupId>
8
     <artifactId>motivateme</artifactId>
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
     <parent>
14
     <parent>
12
         <groupId>org.springframework.boot</groupId>
15
         <groupId>org.springframework.boot</groupId>
13
         <artifactId>spring-boot-starter-parent</artifactId>
16
         <artifactId>spring-boot-starter-parent</artifactId>
14
         <version>2.0.3.RELEASE</version>
17
         <version>2.0.3.RELEASE</version>
18
+        <relativePath/> <!-- lookup parent from repository -->
15
     </parent>
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
     <dependencies>
27
     <dependencies>
18
         <dependency>
28
         <dependency>
19
             <groupId>org.springframework.boot</groupId>
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
             <artifactId>spring-boot-starter-web</artifactId>
42
             <artifactId>spring-boot-starter-web</artifactId>
21
         </dependency>
43
         </dependency>
22
 
44
 
23
         <dependency>
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
         </dependency>
49
         </dependency>
29
-
30
         <dependency>
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
         </dependency>
54
         </dependency>
35
     </dependencies>
55
     </dependencies>
36
 
56
 
37
-    <properties>
38
-        <java.version>1.8</java.version>
39
-    </properties>
40
-
41
-
42
     <build>
57
     <build>
43
         <plugins>
58
         <plugins>
44
             <plugin>
59
             <plugin>
48
         </plugins>
63
         </plugins>
49
     </build>
64
     </build>
50
 
65
 
51
-</project>
66
+
67
+</project>

+ 0
- 11
src/main/java/Controllers/TopicsController.java Bestand weergeven

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 Bestand weergeven

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 Bestand weergeven

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 Bestand weergeven

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
     private int forumId;
4
     private int forumId;
7
 
5
 
8
     public Forum(int forumId) {
6
     public Forum(int forumId) {

src/main/java/View/Inbox.java → src/main/java/com/tyler/motivateme/Inbox.java Bestand weergeven

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
     private int id;
4
     private int id;
7
 
5
 
8
     public Inbox(int id){
6
     public Inbox(int id){

src/main/java/View/MainApplication.java → src/main/java/com/tyler/motivateme/MainApplication.java Bestand weergeven

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

src/main/java/View/MainTopicsPage.java → src/main/java/com/tyler/motivateme/MainTopicsPage.java Bestand weergeven

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

src/main/java/Model/NewTopicCreator.java → src/main/java/com/tyler/motivateme/TopicInfoPage.java Bestand weergeven

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
     public String getDescription() {
5
     public String getDescription() {
9
         return null;
6
         return null;
10
     }
7
     }
11
 
8
 
12
-    @Override
13
     public String getAdviceAndStrategies() {
9
     public String getAdviceAndStrategies() {
14
         return null;
10
         return null;
15
     }
11
     }

src/main/java/Controllers/CommentController.java → src/main/java/com/tyler/motivateme/controller/CommentController.java Bestand weergeven

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

src/main/java/Controllers/MessageController.java → src/main/java/com/tyler/motivateme/controller/MessageController.java Bestand weergeven

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

+ 24
- 0
src/main/java/com/tyler/motivateme/controller/NewTopicCreatorController.java Bestand weergeven

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 Bestand weergeven

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 Bestand weergeven

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 Bestand weergeven

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

src/main/java/View/TopicInfoPage.java → src/main/java/com/tyler/motivateme/model/NewTopicCreator.java Bestand weergeven

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
     public String getDescription() {
6
     public String getDescription() {
7
+
9
         return null;
8
         return null;
10
     }
9
     }
11
 
10
 
12
-    @Override
13
     public String getAdviceAndStrategies() {
11
     public String getAdviceAndStrategies() {
14
         return null;
12
         return null;
15
     }
13
     }

+ 18
- 0
src/main/java/com/tyler/motivateme/model/NewTopicCreatorService.java Bestand weergeven

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 Bestand weergeven

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 Bestand weergeven

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 Bestand weergeven

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 Bestand weergeven

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 Bestand weergeven

1
 package Controllers;
1
 package Controllers;
2
 
2
 
3
 import org.junit.Test;
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
 public class CommentControllerTest {
10
 public class CommentControllerTest {
6
 
11
 
7
     @Test
12
     @Test

+ 6
- 0
src/test/java/Controllers/MessageControllerTest.java Bestand weergeven

1
 package Controllers;
1
 package Controllers;
2
 
2
 
3
 import org.junit.Test;
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
 public class MessageControllerTest {
11
 public class MessageControllerTest {
6
 
12
 
7
     @Test
13
     @Test

+ 6
- 0
src/test/java/Model/ConsoleTest.java Bestand weergeven

1
 package Model;
1
 package Model;
2
 
2
 
3
 import org.junit.Test;
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
 public class ConsoleTest {
11
 public class ConsoleTest {
6
 
12
 
7
     @Test
13
     @Test

+ 10
- 0
src/test/java/Model/NewAccountCreatorTest.java Bestand weergeven

1
 package Model;
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
 public class NewAccountCreatorTest {
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 Bestand weergeven

1
 package Model;
1
 package Model;
2
 
2
 
3
 import org.junit.Test;
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
 public class NewTopicCreatorTest {
10
 public class NewTopicCreatorTest {
6
 
11
 
7
     @Test
12
     @Test

+ 5
- 0
src/test/java/View/ForumTest.java Bestand weergeven

1
 package View;
1
 package View;
2
 
2
 
3
 import org.junit.Test;
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
 public class ForumTest {
10
 public class ForumTest {
6
 
11
 
7
     @Test
12
     @Test

+ 5
- 0
src/test/java/View/InboxTest.java Bestand weergeven

1
 package View;
1
 package View;
2
 
2
 
3
 import org.junit.Test;
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
 public class InboxTest {
10
 public class InboxTest {
6
 
11
 
7
     @Test
12
     @Test

+ 5
- 0
src/test/java/View/MainTopicsPageTest.java Bestand weergeven

1
 package View;
1
 package View;
2
 
2
 
3
 import org.junit.Test;
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
 public class MainTopicsPageTest {
10
 public class MainTopicsPageTest {
6
 
11
 
7
     @Test
12
     @Test

+ 5
- 0
src/test/java/View/TopicInfoPageTest.java Bestand weergeven

1
 package View;
1
 package View;
2
 
2
 
3
 import org.junit.Test;
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
 public class TopicInfoPageTest {
10
 public class TopicInfoPageTest {
6
 
11
 
7
     @Test
12
     @Test