File tree 2 files changed +2
-5
lines changed
rest-adapter/src/test/java/packagename/rest
2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change 19
19
import org .springframework .boot .test .web .client .TestRestTemplate ;
20
20
import org .springframework .boot .test .web .server .LocalServerPort ;
21
21
import org .springframework .http .HttpStatus ;
22
+ import org .springframework .test .context .bean .override .mockito .MockitoBean ;
22
23
import packagename .domain .exception .ExampleNotFoundException ;
23
24
import packagename .domain .model .Example ;
24
25
import packagename .domain .port .RequestExample ;
@@ -34,7 +35,7 @@ public class ExampleResourceTest {
34
35
private static final String API_URI = "/api/v1/examples" ;
35
36
@ LocalServerPort private int port ;
36
37
@ Autowired private TestRestTemplate restTemplate ;
37
- @ Autowired private RequestExample requestExample ;
38
+ @ MockitoBean private RequestExample requestExample ;
38
39
39
40
@ Test
40
41
@ DisplayName ("should start the rest adapter application" )
Original file line number Diff line number Diff line change 2
2
3
3
import org .springframework .boot .SpringApplication ;
4
4
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
- import org .springframework .boot .test .mock .mockito .MockBean ;
6
5
import org .springframework .context .annotation .ComponentScan ;
7
- import packagename .domain .port .RequestExample ;
8
6
9
7
@ SpringBootApplication
10
8
@ ComponentScan (basePackages = "packagename" )
11
9
public class ExampleRestAdapterApplication {
12
10
13
- @ MockBean private RequestExample requestExample ;
14
-
15
11
public static void main (String [] args ) {
16
12
SpringApplication .run (ExampleRestAdapterApplication .class , args );
17
13
}
You can’t perform that action at this time.
0 commit comments