File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 7
7
import org .springframework .boot .test .context .SpringBootTest ;
8
8
import org .springframework .jdbc .core .JdbcTemplate ;
9
9
import org .springframework .test .annotation .DirtiesContext ;
10
+ import roomescape .controller .ReservationController ;
10
11
import roomescape .model .Reservation ;
11
12
12
13
import static org .assertj .core .api .Assertions .assertThat ;
13
14
15
+ import java .lang .reflect .Field ;
14
16
import java .sql .Connection ;
15
17
import java .sql .SQLException ;
16
18
import java .util .HashMap ;
@@ -62,4 +64,21 @@ public class MissionStepTest {
62
64
.then ().log ().all ()
63
65
.statusCode (400 );
64
66
}
67
+
68
+ @ Autowired
69
+ private ReservationController reservationController ;
70
+
71
+ @ Test
72
+ void 십단계 () {
73
+ boolean isJdbcTemplateInjected = false ;
74
+
75
+ for (Field field : reservationController .getClass ().getDeclaredFields ()) {
76
+ if (field .getType ().equals (JdbcTemplate .class )) {
77
+ isJdbcTemplateInjected = true ;
78
+ break ;
79
+ }
80
+ }
81
+
82
+ assertThat (isJdbcTemplateInjected ).isFalse ();
83
+ }
65
84
}
You can’t perform that action at this time.
0 commit comments