File tree Expand file tree Collapse file tree 4 files changed +58
-0
lines changed
src/test/java/guru/springframework/test/ds Expand file tree Collapse file tree 4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ package guru .springframework .test .ds ;
2
+
3
+ import org .springframework .context .annotation .Profile ;
4
+ import org .springframework .stereotype .Component ;
5
+
6
+ /**
7
+ * Created by jt on 5/21/16.
8
+ */
9
+ @ Component
10
+ @ Profile ("dev" )
11
+ public class DevDataSource implements FakeDataSource {
12
+ @ Override
13
+ public String getConnectionInfo () {
14
+ return "I'm the Development DataSource" ;
15
+ }
16
+ }
Original file line number Diff line number Diff line change
1
+ package guru .springframework .test .ds ;
2
+
3
+ /**
4
+ * Created by jt on 5/21/16.
5
+ */
6
+ public interface FakeDataSource {
7
+
8
+ String getConnectionInfo ();
9
+ }
Original file line number Diff line number Diff line change
1
+ package guru .springframework .test .ds ;
2
+
3
+ import org .springframework .context .annotation .Profile ;
4
+ import org .springframework .stereotype .Component ;
5
+
6
+ /**
7
+ * Created by jt on 5/21/16.
8
+ */
9
+ @ Component
10
+ @ Profile ("prod" )
11
+ public class ProdDataSource implements FakeDataSource {
12
+ @ Override
13
+ public String getConnectionInfo () {
14
+ return "I'm the Production Datasource" ;
15
+ }
16
+ }
Original file line number Diff line number Diff line change
1
+ package guru .springframework .test .ds ;
2
+
3
+ import org .springframework .context .annotation .Profile ;
4
+ import org .springframework .stereotype .Component ;
5
+
6
+ /**
7
+ * Created by jt on 5/21/16.
8
+ */
9
+ @ Component
10
+ @ Profile ("qa" )
11
+ public class QADataSource implements FakeDataSource {
12
+
13
+ @ Override
14
+ public String getConnectionInfo () {
15
+ return "I'm the QA Datasource" ;
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments