Merge pull request #5821 from eugenp/Issue-5812
Fixed compiler errors in spring-boot-crud
This commit is contained in:
commit
183d76c45b
|
@ -14,11 +14,10 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
@EnableJpaRepositories(basePackages="com.baeldung.crud.repositories")
|
@EnableJpaRepositories(basePackages="com.baeldung.crud.repositories")
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@EntityScan(basePackages="com.baeldung.crud.entities")
|
@EntityScan(basePackages="com.baeldung.crud.entities")
|
||||||
|
|
||||||
@SpringBootApplication
|
|
||||||
public class Application {
|
public class Application {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Application.class, args);
|
SpringApplication.run(Application.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package com.baeldung.crud.controllers;
|
package com.baeldung.crud.controllers;
|
||||||
|
|
||||||
import com.baeldung.crud.UserRepository;
|
|
||||||
import com.baeldung.crud.entities.User;
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
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.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import com.baeldung.crud.entities.User;
|
||||||
|
import com.baeldung.crud.repositories.UserRepository;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class UserController {
|
public class UserController {
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package com.baeldung.crud;
|
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 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.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.validation.BindingResult;
|
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 {
|
public class UserControllerUnitTest {
|
||||||
|
|
||||||
private static UserController userController;
|
private static UserController userController;
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package com.baeldung.crud;
|
package com.baeldung.crud;
|
||||||
|
|
||||||
import com.baeldung.crud.User;
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import com.baeldung.crud.entities.User;
|
||||||
|
|
||||||
public class UserUnitTest {
|
public class UserUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue