File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
src/test/java/org/mybatis/spring Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -116,14 +116,26 @@ public void testEmptyStringEnvironment() throws Exception {
116
116
}
117
117
118
118
@ Test
119
- public void testNullConfiguration () throws Exception {
119
+ public void testDefaultConfiguration () throws Exception {
120
120
setupFactoryBean ();
121
121
122
- factoryBean .setConfigLocation (null );
123
-
124
122
assertDefaultConfig (factoryBean .getObject ());
125
123
}
126
124
125
+ @ Test
126
+ public void testDefaultConfigurationWithConfigurationProperties () throws Exception {
127
+ setupFactoryBean ();
128
+
129
+ Properties configurationProperties = new Properties ();
130
+ configurationProperties .put ("username" , "dev" );
131
+ factoryBean .setConfigurationProperties (configurationProperties );
132
+
133
+ SqlSessionFactory factory = factoryBean .getObject ();
134
+ assertConfig (factory , SpringManagedTransactionFactory .class );
135
+ assertEquals (1 , factory .getConfiguration ().getVariables ().size ());
136
+ assertEquals ("dev" , factory .getConfiguration ().getVariables ().get ("username" ));
137
+ }
138
+
127
139
@ Test
128
140
public void testSetConfiguration () throws Exception {
129
141
setupFactoryBean ();
You can’t perform that action at this time.
0 commit comments