diff --git a/backend/src/test/java/com/greenfoxacademy/backend/controller/UserRegistrationTest.java b/backend/src/test/java/com/greenfoxacademy/backend/controller/UserRegistrationTest.java index bb9d36d2..2ed163dc 100644 --- a/backend/src/test/java/com/greenfoxacademy/backend/controller/UserRegistrationTest.java +++ b/backend/src/test/java/com/greenfoxacademy/backend/controller/UserRegistrationTest.java @@ -1,7 +1,5 @@ package com.greenfoxacademy.backend.controller; -import static org.junit.jupiter.api.Assertions.assertTrue; - import com.greenfoxacademy.backend.dtos.RegisterUserDto; import com.greenfoxacademy.backend.repositories.UserRepository; import com.greenfoxacademy.backend.services.UserService; @@ -10,6 +8,8 @@ import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.context.SpringBootTest; +import static org.junit.jupiter.api.Assertions.assertTrue; + /** * This class runs a test that verifies if a user is successfully registered in the database. */ @@ -24,7 +24,7 @@ public class UserRegistrationTest { private UserRepository userRepository; @Test - public void userIsSuccessfulRegisteredInDatabase() { + public void userIsSuccessfulRegisteredInDatabase() throws Exception { RegisterUserDto newUser = new RegisterUserDto(); newUser.setFirstName("John"); newUser.setLastName("Doe"); diff --git a/backend/src/test/java/com/greenfoxacademy/backend/controller/UserServiceTest.java b/backend/src/test/java/com/greenfoxacademy/backend/controller/UserServiceTest.java index ebc074e9..e9cf21a8 100644 --- a/backend/src/test/java/com/greenfoxacademy/backend/controller/UserServiceTest.java +++ b/backend/src/test/java/com/greenfoxacademy/backend/controller/UserServiceTest.java @@ -1,8 +1,5 @@ package com.greenfoxacademy.backend.controller; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - import com.greenfoxacademy.backend.dtos.RegisterUserDto; import com.greenfoxacademy.backend.repositories.UserRepository; import com.greenfoxacademy.backend.services.UserService; @@ -12,6 +9,9 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + /** * This class runs a test to verify if the register method in the userService is properly called. */ @@ -27,7 +27,7 @@ public class UserServiceTest { private UserController userController; @Test - public void registerMethodIsSuccessfullyCalled() { + public void registerMethodIsSuccessfullyCalled() throws Exception { RegisterUserDto registerUserDto = new RegisterUserDto(); registerUserDto.setFirstName("John"); registerUserDto.setLastName("Doe");