Merge pull request #5821 from eugenp/Issue-5812

Fixed compiler errors in spring-boot-crud
This commit is contained in:
Eric Martin 2018-12-01 09:48:40 -06:00 committed by GitHub
commit 183d76c45b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 10 deletions

View File

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

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