File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
src/test/java/org/springframework/samples/petclinic/sfg/junit5 Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .springframework .samples .petclinic .sfg .junit5 ;
2
+
3
+ import org .junit .jupiter .api .Test ;
4
+ import org .springframework .beans .factory .annotation .Autowired ;
5
+ import org .springframework .context .annotation .Bean ;
6
+ import org .springframework .context .annotation .Configuration ;
7
+ import org .springframework .samples .petclinic .sfg .HearingInterpreter ;
8
+ import org .springframework .samples .petclinic .sfg .LaurelWordProducer ;
9
+ import org .springframework .test .context .junit .jupiter .SpringJUnitConfig ;
10
+
11
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
12
+
13
+ @ SpringJUnitConfig (classes = HearingInterpreterInnerClassTest .TestConfig .class )
14
+ class HearingInterpreterInnerClassTest {
15
+
16
+ @ Configuration
17
+ static class TestConfig {
18
+
19
+ @ Bean
20
+ HearingInterpreter hearingInterpreter (){
21
+ return new HearingInterpreter (new LaurelWordProducer ());
22
+ }
23
+ }
24
+
25
+ @ Autowired
26
+ HearingInterpreter hearingInterpreter ;
27
+
28
+ @ Test
29
+ void whatIheard () {
30
+ String word = hearingInterpreter .whatIheard ();
31
+
32
+ assertEquals ("Laurel" , word );
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments