diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java index 436cccb964..0b686e90e9 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java @@ -14,11 +14,10 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; @EnableJpaRepositories(basePackages="com.baeldung.crud.repositories") @EnableTransactionManagement @EntityScan(basePackages="com.baeldung.crud.entities") - -@SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } + } diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java b/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java index 1b7185c2fd..9a6cb477aa 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java @@ -1,8 +1,7 @@ package com.baeldung.crud.controllers; -import com.baeldung.crud.UserRepository; -import com.baeldung.crud.entities.User; import javax.validation.Valid; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -11,6 +10,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import com.baeldung.crud.entities.User; +import com.baeldung.crud.repositories.UserRepository; + @Controller public class UserController { diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java b/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java index 7773a962fb..2de0828ae5 100644 --- a/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java +++ b/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java @@ -1,16 +1,18 @@ package com.baeldung.crud; -import com.baeldung.crud.UserController; -import com.baeldung.crud.entities.User; -import com.baeldung.crud.UserRepository; import static org.assertj.core.api.Assertions.assertThat; -import org.junit.BeforeClass; -import org.junit.Test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; + +import org.junit.BeforeClass; +import org.junit.Test; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; +import com.baeldung.crud.controllers.UserController; +import com.baeldung.crud.entities.User; +import com.baeldung.crud.repositories.UserRepository; + public class UserControllerUnitTest { private static UserController userController; diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java b/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java index a3c6a922d8..565f6727c3 100644 --- a/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java +++ b/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java @@ -1,9 +1,11 @@ package com.baeldung.crud; -import com.baeldung.crud.User; import static org.assertj.core.api.Assertions.assertThat; + import org.junit.Test; +import com.baeldung.crud.entities.User; + public class UserUnitTest { @Test