Fixed compiler errors in spring-boot-crud

This commit is contained in:
eric-martin 2018-11-30 22:39:06 -06:00
parent eb1a92698b
commit e884dc1063
4 changed files with 14 additions and 10 deletions

View File

@ -14,8 +14,6 @@ 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) {

View File

@ -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 {

View File

@ -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;

View File

@ -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