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 {
116116 }
117117
118118 @ Test
119- public void testNullConfiguration () throws Exception {
119+ public void testDefaultConfiguration () throws Exception {
120120 setupFactoryBean ();
121121
122- factoryBean .setConfigLocation (null );
123-
124122 assertDefaultConfig (factoryBean .getObject ());
125123 }
126124
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+
127139 @ Test
128140 public void testSetConfiguration () throws Exception {
129141 setupFactoryBean ();
You can’t perform that action at this time.
0 commit comments