File tree Expand file tree Collapse file tree
main/java/com/baeldung/mvc/velocity/controller
test/java/com/baeldung/mvc/velocity/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .baeldung .mvc .velocity .controller ;
22
33import com .baeldung .mvc .velocity .domain .Tutorial ;
4+ import com .baeldung .mvc .velocity .service .ITutorialsService ;
45import com .baeldung .mvc .velocity .service .TutorialsService ;
56import org .springframework .beans .factory .annotation .Autowired ;
67import org .springframework .stereotype .Controller ;
1415@ RequestMapping ("/" )
1516public class MainController {
1617
17- private final TutorialsService tutService ;
18+ private final ITutorialsService tutService ;
1819
1920 @ Autowired
20- public MainController (TutorialsService tutService ) {
21+ public MainController (ITutorialsService tutService ) {
2122 this .tutService = tutService ;
2223 }
2324
@@ -28,7 +29,7 @@ public String listTutorialsPage(Model model) {
2829 return "index" ;
2930 }
3031
31- public TutorialsService getTutService () {
32+ public ITutorialsService getTutService () {
3233 return tutService ;
3334 }
3435}
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public class DataContentControllerTest {
4949 public void setUp () {
5050 Mockito .reset (tutServiceMock );
5151
52- mockMvc = MockMvcBuilders .webAppContextSetup (webApplicationContext ).dispatchOptions ( true ). build ();
52+ mockMvc = MockMvcBuilders .webAppContextSetup (webApplicationContext ).build ();
5353 }
5454
5555 @ Test
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public VelocityConfigurer velocityConfig() {
3131 }
3232
3333 @ Bean
34- public ITutorialsService getTutService () {
34+ public ITutorialsService getTutServiceMock () {
3535 return Mockito .mock (ITutorialsService .class );
3636 }
3737
You can’t perform that action at this time.
0 commit comments