File tree Expand file tree Collapse file tree
main/java/com/baeldung/crud
test/java/com/baeldung/crud Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414@ EnableJpaRepositories (basePackages ="com.baeldung.crud.repositories" )
1515@ EnableTransactionManagement
1616@ EntityScan (basePackages ="com.baeldung.crud.entities" )
17-
18- @ SpringBootApplication
1917public class Application {
2018
2119 public static void main (String [] args ) {
Original file line number Diff line number Diff line change 11package com .baeldung .crud .controllers ;
22
3- import com .baeldung .crud .UserRepository ;
4- import com .baeldung .crud .entities .User ;
53import javax .validation .Valid ;
4+
65import org .springframework .beans .factory .annotation .Autowired ;
76import org .springframework .stereotype .Controller ;
87import org .springframework .ui .Model ;
1110import org .springframework .web .bind .annotation .PathVariable ;
1211import org .springframework .web .bind .annotation .PostMapping ;
1312
13+ import com .baeldung .crud .entities .User ;
14+ import com .baeldung .crud .repositories .UserRepository ;
15+
1416@ Controller
1517public class UserController {
1618
Original file line number Diff line number Diff line change 11package com .baeldung .crud ;
22
3- import com .baeldung .crud .UserController ;
4- import com .baeldung .crud .entities .User ;
5- import com .baeldung .crud .UserRepository ;
63import static org .assertj .core .api .Assertions .assertThat ;
7- import org .junit .BeforeClass ;
8- import org .junit .Test ;
94import static org .mockito .Mockito .mock ;
105import static org .mockito .Mockito .when ;
6+
7+ import org .junit .BeforeClass ;
8+ import org .junit .Test ;
119import org .springframework .ui .Model ;
1210import org .springframework .validation .BindingResult ;
1311
12+ import com .baeldung .crud .controllers .UserController ;
13+ import com .baeldung .crud .entities .User ;
14+ import com .baeldung .crud .repositories .UserRepository ;
15+
1416public class UserControllerUnitTest {
1517
1618 private static UserController userController ;
Original file line number Diff line number Diff line change 11package com .baeldung .crud ;
22
3- import com .baeldung .crud .User ;
43import static org .assertj .core .api .Assertions .assertThat ;
4+
55import org .junit .Test ;
66
7+ import com .baeldung .crud .entities .User ;
8+
79public class UserUnitTest {
810
911 @ Test
You can’t perform that action at this time.
0 commit comments