From 4b0779384937383d7b512c5efb0ea128eac1f388 Mon Sep 17 00:00:00 2001 From: Filip Izydorczyk Date: Mon, 19 Oct 2020 12:33:54 +0200 Subject: [PATCH] Added test to implement and some tests failed rightnow --- .../plannaplan/services/UserServiceTest.java | 15 +++++++++++++ .../src/test/resources/application.properties | 1 + .../controllers/UsersController.java | 5 ----- .../controllers/UsersControllerTest.java | 22 +++++++++++++++++++ .../mappers/UserResponseMappersTest.java | 12 ++++++++++ .../models/SearchForStudentsResponseTest.java | 12 ++++++++++ 6 files changed, 62 insertions(+), 5 deletions(-) create mode 100755 restservice/src/test/java/com/plannaplan/controllers/UsersControllerTest.java create mode 100755 restservice/src/test/java/com/plannaplan/responses/mappers/UserResponseMappersTest.java create mode 100755 restservice/src/test/java/com/plannaplan/responses/models/SearchForStudentsResponseTest.java diff --git a/buisnesslogic/src/test/java/com/plannaplan/services/UserServiceTest.java b/buisnesslogic/src/test/java/com/plannaplan/services/UserServiceTest.java index f24e0d0..951c1b2 100755 --- a/buisnesslogic/src/test/java/com/plannaplan/services/UserServiceTest.java +++ b/buisnesslogic/src/test/java/com/plannaplan/services/UserServiceTest.java @@ -57,4 +57,19 @@ public class UserServiceTest { assertTrue(true); } } + + @Test + public void shouldFindStudents() { + assertTrue(false); + } + + @Test + public void shouldReturnAllStudents() { + assertTrue(false); + } + + @Test + public void shouldntFindStudents() { + assertTrue(false); + } } diff --git a/buisnesslogic/src/test/resources/application.properties b/buisnesslogic/src/test/resources/application.properties index bd77a4e..0477c97 100755 --- a/buisnesslogic/src/test/resources/application.properties +++ b/buisnesslogic/src/test/resources/application.properties @@ -6,5 +6,6 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.open-in-view=true spring.jpa.hibernate.ddl-auto=create-drop spring.jackson.serialization.fail-on-empty-beans=false +spring.main.allow-bean-definition-overriding=true server.port=1285 \ No newline at end of file diff --git a/restservice/src/main/java/com/plannaplan/controllers/UsersController.java b/restservice/src/main/java/com/plannaplan/controllers/UsersController.java index b3d2dd0..d4a4ae1 100755 --- a/restservice/src/main/java/com/plannaplan/controllers/UsersController.java +++ b/restservice/src/main/java/com/plannaplan/controllers/UsersController.java @@ -3,14 +3,9 @@ package com.plannaplan.controllers; import java.util.List; import com.plannaplan.App; -import com.plannaplan.entities.Course; import com.plannaplan.entities.User; -import com.plannaplan.responses.mappers.CoursesResponseMappers; import com.plannaplan.responses.mappers.UserResponseMappers; -import com.plannaplan.responses.models.GetCoursesResponse; -import com.plannaplan.responses.models.GetCoursesWithGroupsResponse; import com.plannaplan.responses.models.SearchForStudentsResponse; -import com.plannaplan.services.CourseService; import com.plannaplan.services.UserService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/restservice/src/test/java/com/plannaplan/controllers/UsersControllerTest.java b/restservice/src/test/java/com/plannaplan/controllers/UsersControllerTest.java new file mode 100755 index 0000000..8ea6d14 --- /dev/null +++ b/restservice/src/test/java/com/plannaplan/controllers/UsersControllerTest.java @@ -0,0 +1,22 @@ +package com.plannaplan.controllers; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.Test; + +public class UsersControllerTest { + @Test + public void shouldRestrun200OK() { + assertTrue(false); + } + + @Test + public void shouldRestrunForbiden() { + assertTrue(false); + } + + @Test + public void shouldFailedDueToMissingParam() { + assertTrue(false); + } +} diff --git a/restservice/src/test/java/com/plannaplan/responses/mappers/UserResponseMappersTest.java b/restservice/src/test/java/com/plannaplan/responses/mappers/UserResponseMappersTest.java new file mode 100755 index 0000000..132dbb1 --- /dev/null +++ b/restservice/src/test/java/com/plannaplan/responses/mappers/UserResponseMappersTest.java @@ -0,0 +1,12 @@ +package com.plannaplan.responses.mappers; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.Test; + +public class UserResponseMappersTest { + @Test + public void shlouldMapListToResponseList() { + assertTrue(false); + } +} diff --git a/restservice/src/test/java/com/plannaplan/responses/models/SearchForStudentsResponseTest.java b/restservice/src/test/java/com/plannaplan/responses/models/SearchForStudentsResponseTest.java new file mode 100755 index 0000000..7068159 --- /dev/null +++ b/restservice/src/test/java/com/plannaplan/responses/models/SearchForStudentsResponseTest.java @@ -0,0 +1,12 @@ +package com.plannaplan.responses.models; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.Test; + +public class SearchForStudentsResponseTest { + @Test + public void shouldMapUserToResponseElement() { + assertTrue(false); + } +}