File tree 4 files changed +14
-10
lines changed
main/java/com/baeldung/crud
test/java/com/baeldung/crud
4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 14
14
@ EnableJpaRepositories (basePackages ="com.baeldung.crud.repositories" )
15
15
@ EnableTransactionManagement
16
16
@ EntityScan (basePackages ="com.baeldung.crud.entities" )
17
-
18
- @ SpringBootApplication
19
17
public class Application {
20
18
21
19
public static void main (String [] args ) {
Original file line number Diff line number Diff line change 1
1
package com .baeldung .crud .controllers ;
2
2
3
- import com .baeldung .crud .UserRepository ;
4
- import com .baeldung .crud .entities .User ;
5
3
import javax .validation .Valid ;
4
+
6
5
import org .springframework .beans .factory .annotation .Autowired ;
7
6
import org .springframework .stereotype .Controller ;
8
7
import org .springframework .ui .Model ;
11
10
import org .springframework .web .bind .annotation .PathVariable ;
12
11
import org .springframework .web .bind .annotation .PostMapping ;
13
12
13
+ import com .baeldung .crud .entities .User ;
14
+ import com .baeldung .crud .repositories .UserRepository ;
15
+
14
16
@ Controller
15
17
public class UserController {
16
18
Original file line number Diff line number Diff line change 1
1
package com .baeldung .crud ;
2
2
3
- import com .baeldung .crud .UserController ;
4
- import com .baeldung .crud .entities .User ;
5
- import com .baeldung .crud .UserRepository ;
6
3
import static org .assertj .core .api .Assertions .assertThat ;
7
- import org .junit .BeforeClass ;
8
- import org .junit .Test ;
9
4
import static org .mockito .Mockito .mock ;
10
5
import static org .mockito .Mockito .when ;
6
+
7
+ import org .junit .BeforeClass ;
8
+ import org .junit .Test ;
11
9
import org .springframework .ui .Model ;
12
10
import org .springframework .validation .BindingResult ;
13
11
12
+ import com .baeldung .crud .controllers .UserController ;
13
+ import com .baeldung .crud .entities .User ;
14
+ import com .baeldung .crud .repositories .UserRepository ;
15
+
14
16
public class UserControllerUnitTest {
15
17
16
18
private static UserController userController ;
Original file line number Diff line number Diff line change 1
1
package com .baeldung .crud ;
2
2
3
- import com .baeldung .crud .User ;
4
3
import static org .assertj .core .api .Assertions .assertThat ;
4
+
5
5
import org .junit .Test ;
6
6
7
+ import com .baeldung .crud .entities .User ;
8
+
7
9
public class UserUnitTest {
8
10
9
11
@ Test
You can’t perform that action at this time.
0 commit comments