ShowTablesBackendHandler implements TextProtocolBackendHandler { @Override public BackendResponse execute() throws SQLException { ShardingSphereSchema schema = ProxyContext.getInstance().getSchema(backendConnection.getSchemaName()); if (null == schema) { throw new NoDatabaseSelectedException(); } if (!schema.isComplete()) { return getDefaultQueryResponse(backendConnection.getSchemaName()); } databaseCommunicationEngine = databaseCommunicationEngineFactory.newTextProtocolInstance(sqlStatement, sql, backendConnection); return databaseCommunicationEngine.execute(); }  @Override BackendResponse execute(); @Override boolean next(); @Override QueryData getQueryData();  }
@Test public void assertExecuteShowTablesBackendHandler() throws SQLException { QueryResponse actual = (QueryResponse) tablesBackendHandler.execute(); assertThat(actual, instanceOf(QueryResponse.class)); assertThat(actual.getQueryHeaders().size(), is(1)); }