@@ -114,29 +114,29 @@ private MetaDataContexts mockMetaDataContexts(final ShardingSphereDatabase datab
114114 void assertExecuteDataSourcesContext () throws SQLException {
115115 RegisterStorageUnitStatement sqlStatement = mock (RegisterStorageUnitStatement .class );
116116 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
117- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
117+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
118118 }
119119
120120 @ Test
121121 void assertExecuteShardingTableRuleContext () throws SQLException {
122122 when (contextManager .getDatabase ("foo_db" ).getRuleMetaData ()).thenReturn (new RuleMetaData (Collections .emptyList ()));
123123 CreateShardingTableRuleStatement sqlStatement = mock (CreateShardingTableRuleStatement .class );
124124 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
125- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
125+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
126126 }
127127
128128 @ Test
129129 void assertExecuteAddResourceContext () throws SQLException {
130130 RegisterStorageUnitStatement sqlStatement = mock (RegisterStorageUnitStatement .class );
131131 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
132- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
132+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
133133 }
134134
135135 @ Test
136136 void assertExecuteAlterResourceContext () throws SQLException {
137137 AlterStorageUnitStatement sqlStatement = mock (AlterStorageUnitStatement .class );
138138 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
139- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
139+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
140140 }
141141
142142 @ Test
@@ -145,7 +145,7 @@ void assertExecuteAlterShadowRuleContext() throws SQLException {
145145 when (contextManager .getDatabase ("foo_db" )).thenReturn (database );
146146 AlterShadowRuleStatement sqlStatement = mock (AlterShadowRuleStatement .class );
147147 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
148- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
148+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
149149 }
150150
151151 @ Test
@@ -154,7 +154,7 @@ void assertExecuteCreateShadowRuleContext() throws SQLException {
154154 when (contextManager .getDatabase ("foo_db" )).thenReturn (database );
155155 CreateShadowRuleStatement sqlStatement = mock (CreateShadowRuleStatement .class );
156156 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
157- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
157+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
158158 }
159159
160160 @ Test
@@ -163,7 +163,7 @@ void assertExecuteDropShadowRuleContext() throws SQLException {
163163 when (contextManager .getDatabase ("foo_db" )).thenReturn (database );
164164 DropShadowRuleStatement sqlStatement = mock (DropShadowRuleStatement .class );
165165 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
166- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
166+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
167167 }
168168
169169 @ Test
@@ -172,7 +172,7 @@ void assertExecuteAlterDefaultShadowAlgorithm() throws SQLException {
172172 when (contextManager .getDatabase ("foo_db" )).thenReturn (database );
173173 AlterDefaultShadowAlgorithmStatement statement = new AlterDefaultShadowAlgorithmStatement (
174174 new ShadowAlgorithmSegment ("foo" , new AlgorithmSegment ("SQL_HINT" , PropertiesBuilder .build (new Property ("type" , "value" )))));
175- assertThat (new DistSQLUpdateProxyBackendHandler (statement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
175+ assertThat (new DistSQLUpdateProxyBackendHandler (statement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
176176 }
177177
178178 @ Test
@@ -205,33 +205,33 @@ void assertExecuteDropShadowAlgorithmContext() throws SQLException {
205205 when (contextManager .getDatabase ("foo_db" )).thenReturn (database );
206206 DropShadowAlgorithmStatement sqlStatement = mock (DropShadowAlgorithmStatement .class );
207207 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
208- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
208+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
209209 }
210210
211211 @ Test
212212 void assertExecuteDropResourceContext () throws SQLException {
213213 UnregisterStorageUnitStatement sqlStatement = mock (UnregisterStorageUnitStatement .class );
214214 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
215- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
215+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
216216 }
217217
218218 @ Test
219219 void assertExecuteDropReadwriteSplittingRuleContext () {
220220 assertThrows (MissingRequiredRuleException .class ,
221- () -> new DistSQLUpdateProxyBackendHandler (mock (DropReadwriteSplittingRuleStatement .class , RETURNS_DEEP_STUBS ), connectionSession , contextManager ).execute ());
221+ () -> new DistSQLUpdateProxyBackendHandler (mock (DropReadwriteSplittingRuleStatement .class , RETURNS_DEEP_STUBS ), mock (), connectionSession , contextManager ).execute ());
222222 }
223223
224224 @ Test
225225 void assertExecuteCreateReadwriteSplittingRuleContext () throws SQLException {
226226 CreateReadwriteSplittingRuleStatement sqlStatement = mock (CreateReadwriteSplittingRuleStatement .class );
227227 when (sqlStatement .getAttributes ()).thenReturn (new SQLStatementAttributes ());
228- assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
228+ assertThat (new DistSQLUpdateProxyBackendHandler (sqlStatement , mock (), connectionSession , contextManager ).execute (), isA (UpdateResponseHeader .class ));
229229 }
230230
231231 @ Test
232232 void assertExecuteAlterReadwriteSplittingRuleContext () {
233233 assertThrows (MissingRequiredRuleException .class ,
234- () -> new DistSQLUpdateProxyBackendHandler (mock (AlterReadwriteSplittingRuleStatement .class , RETURNS_DEEP_STUBS ), connectionSession , contextManager ).execute ());
234+ () -> new DistSQLUpdateProxyBackendHandler (mock (AlterReadwriteSplittingRuleStatement .class , RETURNS_DEEP_STUBS ), mock (), connectionSession , contextManager ).execute ());
235235 }
236236
237237 private ShardingSphereDatabase mockDatabaseWithRule () {
0 commit comments