You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by yx...@apache.org on 2022/04/16 12:50:53 UTC
[shardingsphere] branch master updated: Unit test code inspection. (#16873)
This is an automated email from the ASF dual-hosted git repository.
yx9o pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new dd970861078 Unit test code inspection. (#16873)
dd970861078 is described below
commit dd97086107831f66577b90ffd99ac640779645a8
Author: 龙台 Long Tai <77...@users.noreply.github.com>
AuthorDate: Sat Apr 16 20:50:45 2022 +0800
Unit test code inspection. (#16873)
* Unit test code inspection.
* Unit test code inspection.
* Unit test code inspection.
---
.../api/advice/SQLRouteEngineAdviceTest.java | 2 +-
.../metrics/prometheus/util/ReflectiveUtil.java | 2 +-
.../advice/JDBCExecutorCallbackAdviceTest.java | 2 +-
.../jaeger/advice/SQLParserEngineAdviceTest.java | 2 +-
.../advice/CommandExecutorTaskAdviceTest.java | 10 ++--
.../advice/JDBCExecutorCallbackAdviceTest.java | 10 ++--
.../advice/SQLParserEngineAdviceTest.java | 14 ++---
.../collector/OpenTelemetryCollector.java | 12 ++---
.../OpenTelemetryTracingPluginBootServiceTest.java | 8 +--
.../mysql/codec/MySQLPacketCodecEngineTest.java | 4 +-
.../command/MySQLCommandPacketTypeLoaderTest.java | 2 +-
.../execute/MySQLBinaryResultSetRowPacketTest.java | 2 +-
.../encrypt/context/EncryptContextBuilderTest.java | 4 +-
.../impl/EncryptAlterTableTokenGeneratorTest.java | 4 +-
.../impl/EncryptOrderByItemTokenGeneratorTest.java | 11 ++--
.../token/EncryptAssignmentTokenGeneratorTest.java | 32 +++++------
.../CreateEncryptRuleStatementUpdaterTest.java | 2 +-
.../spring/boot/EncryptSpringBootStarterTest.java | 8 +--
.../condition/EncryptSpringBootConditionTest.java | 1 -
...teSplittingDataSourceRuleConfigurationTest.java | 14 ++---
.../HintShadowAlgorithmDeterminerTest.java | 6 +--
.../ShadowSelectStatementRoutingEngineTest.java | 10 ++--
.../ShadowUpdateStatementRoutingEngineTest.java | 10 ++--
.../route/engine/util/ShadowExtractorTest.java | 2 +-
.../ShadowDataSourcePropertiesYamlSwapperTest.java | 4 +-
.../ShadowTableConfigurationYamlSwapperTest.java | 2 +-
.../datetime/IntervalShardingAlgorithmTest.java | 30 +++++------
.../inline/InlineExpressionParserTest.java | 8 +--
...ssBasedComplexKeysShardingAlgorithmFixture.java | 6 +--
.../ClassBasedHintShardingAlgorithmFixture.java | 6 +--
...ClassBasedStandardShardingAlgorithmFixture.java | 8 +--
.../merge/ShardingResultMergerEngineTest.java | 10 ++--
.../dql/groupby/GroupByMemoryMergedResultTest.java | 2 +-
.../dql/groupby/GroupByRowComparatorTest.java | 62 +++++++++++-----------
.../merge/dql/orderby/OrderByValueTest.java | 34 ++++++------
.../TopAndRowNumberDecoratorMergedResultTest.java | 4 +-
.../ShardingSQLRewriteContextDecoratorTest.java | 8 +--
.../ShardingPaginationParameterRewriterTest.java | 16 +++---
.../AggregationDistinctTokenGeneratorTest.java | 4 +-
.../token/ConstraintTokenGeneratorTest.java | 4 +-
...DistinctProjectionPrefixTokenGeneratorTest.java | 4 +-
.../GeneratedKeyAssignmentTokenGeneratorTest.java | 2 +-
...rUseDefaultInsertColumnsTokenGeneratorTest.java | 2 +-
...GeneratedKeyInsertColumnTokenGeneratorTest.java | 2 +-
...GeneratedKeyInsertValuesTokenGeneratorTest.java | 8 +--
.../rewrite/token/IndexTokenGeneratorTest.java | 4 +-
.../rewrite/token/OffsetTokenGeneratorTest.java | 4 +-
.../rewrite/token/OrderByTokenGeneratorTest.java | 12 ++---
.../token/ProjectionsTokenGeneratorTest.java | 30 +++++------
.../rewrite/token/RowCountTokenGeneratorTest.java | 4 +-
.../ShardingInsertValuesTokenGeneratorTest.java | 4 +-
.../rewrite/token/TableTokenGeneratorTest.java | 2 +-
.../rewrite/token/pojo/OrderByTokenTest.java | 6 +--
.../token/pojo/ShardingInsertValuesTokenTest.java | 8 +--
.../condition/ExpressionConditionUtilsTest.java | 2 +-
.../ConditionValueGeneratorFactoryTest.java | 10 ++--
.../condition/generator/ConditionValueTest.java | 7 ++-
.../type/ShardingRouteEngineFactoryTest.java | 4 +-
.../unicast/ShardingUnicastRoutingEngineTest.java | 4 +-
.../ShardingRenameTableStatementValidatorTest.java | 14 ++---
.../sharding/rule/TableRuleTest.java | 4 +-
...ledShardingScalingRuleStatementUpdaterTest.java | 2 +-
...bleShardingScalingRuleStatementUpdaterTest.java | 2 +-
...gTableRulesUsedAlgorithmQueryResultSetTest.java | 14 ++---
.../insert/values/InsertValueContextTest.java | 2 +-
.../groupby/engine/GroupByContextEngineTest.java | 20 +++----
.../engine/PaginationContextEngineTest.java | 16 +++---
.../projection/engine/ProjectionEngineTest.java | 2 +-
.../engine/ProjectionsContextEngineTest.java | 2 +-
.../projection/impl/AggregationProjectionTest.java | 16 +++---
.../dal/AnalyzeTableStatementContextTest.java | 6 +--
.../statement/dal/ExplainStatementContextTest.java | 6 +--
.../dal/ShowColumnsStatementContextTest.java | 2 +-
.../dal/ShowCreateTableStatementContextTest.java | 2 +-
.../dal/ShowIndexStatementContextTest.java | 2 +-
.../dcl/DenyUserStatementContextTest.java | 2 +-
.../statement/dcl/GrantStatementContextTest.java | 12 ++---
.../statement/dcl/RevokeStatementContextTest.java | 12 ++---
.../ddl/AlterIndexStatementContextTest.java | 8 +--
.../ddl/AlterTableStatementContextTest.java | 12 ++---
.../ddl/AlterViewStatementContextTest.java | 10 ++--
.../ddl/CreateDatabaseStatementContextTest.java | 6 +--
.../ddl/CreateFunctionStatementContextTest.java | 8 +--
.../ddl/CreateIndexStatementContextTest.java | 10 ++--
.../ddl/CreateProcedureStatementContextTest.java | 6 +--
.../ddl/CreateTableStatementContextTest.java | 12 ++---
.../ddl/CreateViewStatementContextTest.java | 6 +--
.../ddl/DropIndexStatementContextTest.java | 10 ++--
.../ddl/DropTableStatementContextTest.java | 12 ++---
.../ddl/DropViewStatementContextTest.java | 6 +--
.../statement/ddl/PrepareStatementContextTest.java | 16 +++---
.../ddl/TruncateStatementContextTest.java | 8 +--
.../statement/impl/SelectStatementContextTest.java | 8 +--
.../checker/RuleConfigurationCheckerFixture.java | 8 +--
.../database/metadata/DataSourceMetaDataTest.java | 12 ++---
.../metadata/dialect/H2DataSourceMetaDataTest.java | 16 +++---
.../dialect/SQLServerDataSourceMetaDataTest.java | 4 +-
.../database/type/DatabaseTypeRecognizerTest.java | 24 ++++-----
.../infra/datanode/DataNodeTest.java | 4 +-
.../infra/instance/InstanceContextTest.java | 16 +++---
.../instance/fixture/WorkerIdGeneratorFixture.java | 5 +-
.../rule/ShardingSphereRuleMetaDataTest.java | 14 ++---
.../spi/DialectTableMetaDataLoaderFactoryTest.java | 12 ++---
.../metadata/user/ShardingSphereUsersTest.java | 2 +-
.../YamlRuleConfigurationSwapperFactoryTest.java | 6 +--
.../mode/ModeConfigurationYamlSwapperTest.java | 8 +--
.../thread/ExecutorThreadFactoryBuilderTest.java | 9 ++--
.../builder/DefaultTokenGeneratorBuilderTest.java | 8 +--
.../sql/token/pojo/generic/OwnerTokenTest.java | 4 +-
.../route/engine/AllSQLRouteExecutorTest.java | 2 +-
.../driver/jdbc/adapter/ResultSetAdapterTest.java | 2 +-
.../resultset/DatabaseMetaDataResultSetTest.java | 6 +--
.../core/resultset/GeneratedKeysResultSetTest.java | 2 +-
.../jdbc/core/resultset/ResultSetUtilTest.java | 2 +-
.../resultset/ShardingSphereResultSetTest.java | 6 +--
.../jdbc/core/statement/EncryptStatementTest.java | 2 +-
.../statement/ShardingSphereStatementTest.java | 4 +-
.../UnsupportedOperationResultSetTest.java | 3 +-
.../spring/boot/SpringBootStarterTest.java | 4 +-
.../mysql/ingest/MySQLPositionInitializerTest.java | 1 -
.../mysql/ingest/binlog/BinlogContextTest.java | 2 +-
.../value/MySQLDataTypeHandlerFactoryTest.java | 10 ++--
.../datasource/MySQLDataSourcePreparerTest.java | 2 +-
.../ingest/wal/decode/TestDecodingPluginTest.java | 4 +-
.../datasource/PipelineDataSourceWrapperTest.java | 34 ++++++------
...gSpherePipelineDataSourceConfigurationTest.java | 4 +-
.../namespace/SQLParserSpringNamespaceTest.java | 2 +-
...gleTableSchemaRuleConfigurationBuilderTest.java | 4 +-
...rafficStrategyConfigurationYamlSwapperTest.java | 22 ++++----
...herShardingSphereTransactionManagerFixture.java | 4 +-
.../ShardingSphereTransactionManagerFixture.java | 4 +-
.../xa/jta/datasource/XADataSourceFactoryTest.java | 4 +-
.../datasource/XATransactionDataSourceTest.java | 1 -
.../XADataSourceDefinitionFactoryTest.java | 2 +-
.../ContextManagerBuilderParameterTest.java | 24 ++++-----
.../mode/manager/ContextManagerTest.java | 6 +--
.../persist/node/SchemaMetaDataNodeTest.java | 10 ++--
.../ClusterContextManagerCoordinatorTest.java | 14 ++---
.../ClusterPersistRepositoryFactoryTest.java | 4 +-
.../lock/DistributeLockContextTest.java | 2 +-
.../cluster/etcd/EtcdRepositoryTest.java | 10 ++--
...sistRepositoryConfigurationYamlSwapperTest.java | 10 ++--
.../StandalonePersistRepositoryFactoryTest.java | 8 +--
.../StandalonePersistRepositoryFixture.java | 16 +++---
...positoryConfigurationYamlSwapperEngineTest.java | 4 +-
.../repository/standalone/h2/H2RepositoryTest.java | 6 +--
.../fixture/CallTimeRecordDataSource.java | 2 +-
...amlProxyDataSourceConfigurationSwapperTest.java | 6 +--
.../TableModifyInTransactionExceptionTest.java | 8 +--
...QLStatementContextInstanceOfTableAvailable.java | 10 ++--
.../response/data/QueryResponseRowTest.java | 8 +--
.../header/update/UpdateResponseHeaderTest.java | 6 +--
.../information/SelectInformationExecutorTest.java | 6 +--
.../executor/SelectDatabaseExecutorTest.java | 12 ++---
.../common/updatable/AlterInstanceHandlerTest.java | 8 +--
.../TransactionBackendHandlerFactoryTest.java | 2 +-
.../fixture/RuleConfigurationFixtureChecker.java | 6 +--
.../frontend/mysql/MySQLFrontendEngineTest.java | 2 +-
.../mysql/err/MySQLErrPacketFactoryTest.java | 4 +-
.../spi/type/ordered/OrderedSPIRegistryTest.java | 4 +-
.../DefaultMultipleRequiredSPIFixtureImpl.java | 1 -
.../sql/parser/mysql/MySQLXAVisitorTest.java | 16 +++---
.../util/ColumnExtractorParameterizedTest.java | 12 ++---
.../sql/common/util/ExpressionExtractUtilTest.java | 8 +--
.../sql/parser/sql/common/util/SQLUtilTest.java | 2 +-
.../sql/common/util/SubqueryExtractUtilTest.java | 14 ++---
.../sql/common/util/WhereExtractUtilTest.java | 6 +--
.../value/identifier/IdentifierValueTest.java | 6 +--
.../agent/test/common/entity/OrderEntity.java | 4 +-
.../agent/test/common/util/OkHttpUtils.java | 2 +-
.../agent/test/metrics/MetricsPluginIT.java | 2 +-
.../test/opentelemetry/OpenTelemetryPluginIT.java | 2 +-
.../test/opentelemetry/result/TracingResult.java | 14 ++---
.../scaling/test/mysql/env/cases/DataSet.java | 1 -
.../assertion/IntegrationTestCaseAssertion.java | 2 +-
.../adapter/impl/ShardingSphereProxyContainer.java | 2 +-
.../parallel/impl/CaseParallelRunnerExecutor.java | 2 +-
.../DistSQLParserParameterizedTest.java | 2 +-
.../pipeline/core/execute/ExecuteEngineTest.java | 4 +-
.../progress/yaml/JobProgressYamlSwapperTest.java | 10 ++--
.../pipeline/core/lock/PipelineSimpleLockTest.java | 2 +-
.../metadata/model/PipelineTableMetaDataTest.java | 10 ++--
.../data/pipeline/core/record/RecordUtilTest.java | 8 +--
.../pipeline/core/util/ConfigurationFileUtil.java | 2 +-
.../spi/DefaultSourceWritingStopAlgorithmTest.java | 16 +++---
.../ShardingSQLRewriterParameterizedTest.java | 6 +--
186 files changed, 705 insertions(+), 711 deletions(-)
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-api/src/test/java/org/apache/shardingsphere/agent/metrics/api/advice/SQLRouteEngineAdviceTest.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-api/src/test/java/org/apache/shardingsphere/agent/metrics/api/advice/SQLRouteEngineAdviceTest.java
index 59f67d45f41..c94be982619 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-api/src/test/java/org/apache/shardingsphere/agent/metrics/api/advice/SQLRouteEngineAdviceTest.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-api/src/test/java/org/apache/shardingsphere/agent/metrics/api/advice/SQLRouteEngineAdviceTest.java
@@ -75,7 +75,7 @@ public final class SQLRouteEngineAdviceTest extends MetricsAdviceBaseTest {
assertTrue(MetricsPool.get(metricIds).isPresent());
assertThat(((FixtureWrapper) MetricsPool.get(metricIds).get()).getFixtureValue(), is(1.0));
}
-
+
@Test
public void assertRouteDataSourceAndTable() {
MockAdviceTargetObject targetObject = new MockAdviceTargetObject();
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/test/java/org/apache/shardingsphere/agent/metrics/prometheus/util/ReflectiveUtil.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/test/java/org/apache/shardingsphere/agent/metrics/prometheus/util/ReflectiveUtil.java
index fc870c92194..7127fc62b72 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/test/java/org/apache/shardingsphere/agent/metrics/prometheus/util/ReflectiveUtil.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-metrics/shardingsphere-agent-metrics-prometheus/src/test/java/org/apache/shardingsphere/agent/metrics/prometheus/util/ReflectiveUtil.java
@@ -52,7 +52,7 @@ public final class ReflectiveUtil {
}
return result;
}
-
+
private static Field getField(final Class<?> clazz, final String fieldName) {
Field[] fields = clazz.getDeclaredFields();
return fields.length != 0 ? Arrays.stream(fields).filter(each -> fieldName.equals(each.getName())).findFirst().orElse(null) : null;
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/JDBCExecutorCallbackAdviceTest.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/JDBCExecutorCallbackAdviceTest.java
index 6448406a4c8..16d5b4ae009 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/JDBCExecutorCallbackAdviceTest.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/JDBCExecutorCallbackAdviceTest.java
@@ -38,7 +38,7 @@ public final class JDBCExecutorCallbackAdviceTest extends AbstractJDBCExecutorCa
@ClassRule
public static final JaegerCollector COLLECTOR = new JaegerCollector();
-
+
private static final JDBCExecutorCallbackAdvice ADVICE = new JDBCExecutorCallbackAdvice();
@Before
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/SQLParserEngineAdviceTest.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/SQLParserEngineAdviceTest.java
index b815f187270..61d924c73b6 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/SQLParserEngineAdviceTest.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-jaeger/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/SQLParserEngineAdviceTest.java
@@ -37,7 +37,7 @@ public final class SQLParserEngineAdviceTest extends AbstractSQLParserEngineAdvi
@ClassRule
public static final JaegerCollector COLLECTOR = new JaegerCollector();
-
+
private static final SQLParserEngineAdvice ADVICE = new SQLParserEngineAdvice();
@Test
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/CommandExecutorTaskAdviceTest.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/CommandExecutorTaskAd [...]
index a13c3d02521..6ee88f1537e 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/CommandExecutorTaskAdviceTest.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/CommandExecutorTaskAdviceTest.java
@@ -37,17 +37,17 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
public final class CommandExecutorTaskAdviceTest extends AbstractCommandExecutorTaskAdviceTest {
-
+
@ClassRule
public static final OpenTelemetryCollector COLLECTOR = new OpenTelemetryCollector();
-
+
private CommandExecutorTaskAdvice advice;
-
+
@Before
public void setup() {
advice = new CommandExecutorTaskAdvice();
}
-
+
@Test
public void assertMethod() {
advice.beforeMethod(getTargetObject(), null, new Object[]{}, new MethodInvocationResult());
@@ -60,7 +60,7 @@ public final class CommandExecutorTaskAdviceTest extends AbstractCommandExecutor
assertThat(spanData.getAttributes().get(AttributeKey.stringKey(OpenTelemetryConstants.COMPONENT)), is(OpenTelemetryConstants.COMPONENT_NAME));
assertThat(spanData.getKind(), is(SpanKind.CLIENT));
}
-
+
@Test
public void assertExceptionHandle() {
advice.beforeMethod(getTargetObject(), null, new Object[]{}, new MethodInvocationResult());
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/JDBCExecutorCallbackAdviceTest.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/JDBCExecutorCallback [...]
index d0795114275..0b1ac4ac8bf 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/JDBCExecutorCallbackAdviceTest.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/JDBCExecutorCallbackAdviceTest.java
@@ -37,17 +37,17 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
public final class JDBCExecutorCallbackAdviceTest extends AbstractJDBCExecutorCallbackAdviceTest {
-
+
@ClassRule
public static final OpenTelemetryCollector COLLECTOR = new OpenTelemetryCollector();
-
+
private JDBCExecutorCallbackAdvice advice;
-
+
@Before
public void setup() {
advice = new JDBCExecutorCallbackAdvice();
}
-
+
@Test
public void assertMethod() {
advice.beforeMethod(getTargetObject(), null, new Object[]{getExecutionUnit(), false, getExtraMap()}, new MethodInvocationResult());
@@ -64,7 +64,7 @@ public final class JDBCExecutorCallbackAdviceTest extends AbstractJDBCExecutorCa
assertThat(attributes.get(AttributeKey.stringKey(OpenTelemetryConstants.DB_INSTANCE)), is("mock.db"));
assertThat(attributes.get(AttributeKey.stringKey(OpenTelemetryConstants.DB_STATEMENT)), is("select 1"));
}
-
+
@Test
public void assertExceptionHandle() {
advice.beforeMethod(getTargetObject(), null, new Object[]{getExecutionUnit(), false, getExtraMap()}, new MethodInvocationResult());
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/SQLParserEngineAdviceTest.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/SQLParserEngineAdviceTest.java
index 5fa114b4c5d..35dfe2c0541 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/SQLParserEngineAdviceTest.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice/SQLParserEngineAdviceTest.java
@@ -40,16 +40,16 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
public final class SQLParserEngineAdviceTest extends AbstractSQLParserEngineAdviceTest {
-
+
@ClassRule
public static final OpenTelemetryCollector COLLECTOR = new OpenTelemetryCollector();
-
+
private static final String SQL_STMT = "select 1";
-
+
private SQLParserEngineAdvice advice;
-
+
private Span parentSpan;
-
+
@Before
public void setup() {
parentSpan = GlobalOpenTelemetry.getTracer("shardingsphere-agent")
@@ -58,7 +58,7 @@ public final class SQLParserEngineAdviceTest extends AbstractSQLParserEngineAdvi
ExecutorDataMap.getValue().put(OpenTelemetryConstants.ROOT_SPAN, parentSpan);
advice = new SQLParserEngineAdvice();
}
-
+
@Test
public void assertMethod() {
advice.beforeMethod(getTargetObject(), null, new Object[]{SQL_STMT, true}, new MethodInvocationResult());
@@ -75,7 +75,7 @@ public final class SQLParserEngineAdviceTest extends AbstractSQLParserEngineAdvi
assertThat(attributes.get(AttributeKey.stringKey(OpenTelemetryConstants.DB_TYPE)), is(OpenTelemetryConstants.DB_TYPE_VALUE));
assertThat(attributes.get(AttributeKey.stringKey(OpenTelemetryConstants.DB_STATEMENT)), is(SQL_STMT));
}
-
+
@Test
public void assertExceptionHandle() {
advice.beforeMethod(getTargetObject(), null, new Object[]{SQL_STMT, true}, new MethodInvocationResult());
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/collector/OpenTelemetryCollector.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/collector/OpenTelemetryCollector.java
index 452cffc7a65..14cc9542c98 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/collector/OpenTelemetryCollector.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/collector/OpenTelemetryCollector.java
@@ -29,9 +29,9 @@ import org.junit.rules.ExternalResource;
import java.util.List;
public final class OpenTelemetryCollector extends ExternalResource implements CollectorRule {
-
+
private final InMemorySpanExporter testExporter = InMemorySpanExporter.create();
-
+
@Override
protected void before() {
SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder()
@@ -42,21 +42,21 @@ public final class OpenTelemetryCollector extends ExternalResource implements Co
.buildAndRegisterGlobal()
.getTracer("shardingsphere-agent");
}
-
+
/**
* Get a List of the finished Spans, represented by SpanData.
- *
+ *
* @return a List of the finished Spans.
*/
public List<SpanData> getSpanItems() {
return testExporter.getFinishedSpanItems();
}
-
+
@Override
public void cleanup() {
testExporter.reset();
}
-
+
@Override
protected void after() {
GlobalOpenTelemetry.resetForTest();
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/service/OpenTelemetryTracingPluginBootServiceTest.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/service/OpenTel [...]
index 0cb8c934a9e..6b864aecc54 100644
--- a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/service/OpenTelemetryTracingPluginBootServiceTest.java
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-tracing/shardingsphere-agent-tracing-opentelemetry/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/service/OpenTelemetryTracingPluginBootServiceTest.java
@@ -29,9 +29,9 @@ import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.is;
public final class OpenTelemetryTracingPluginBootServiceTest {
-
+
private final OpenTelemetryTracingPluginBootService openTelemetryTracingPluginBootService = new OpenTelemetryTracingPluginBootService();
-
+
@Test
public void assertStart() {
Properties props = new Properties();
@@ -42,12 +42,12 @@ public final class OpenTelemetryTracingPluginBootServiceTest {
assertNotNull(GlobalOpenTelemetry.getTracerProvider());
assertNotNull(GlobalOpenTelemetry.getTracer("shardingsphere-agent"));
}
-
+
@Test
public void assertType() {
assertThat(openTelemetryTracingPluginBootService.getType(), is("OpenTelemetry"));
}
-
+
@After
public void close() {
openTelemetryTracingPluginBootService.close();
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngineTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngineTest.java
index df929e13218..a9d6c10bc42 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngineTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/codec/MySQLPacketCodecEngineTest.java
@@ -79,7 +79,7 @@ public final class MySQLPacketCodecEngineTest {
new MySQLPacketCodecEngine().decode(context, byteBuf, out);
assertThat(out.size(), is(1));
}
-
+
@Test
public void assertDecodeWithEmptyPacket() {
when(byteBuf.markReaderIndex()).thenReturn(byteBuf);
@@ -89,7 +89,7 @@ public final class MySQLPacketCodecEngineTest {
new MySQLPacketCodecEngine().decode(context, byteBuf, out);
assertThat(out.size(), is(1));
}
-
+
@Test
public void assertDecodeWithStickyPacket() {
when(byteBuf.markReaderIndex()).thenReturn(byteBuf);
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/MySQLCommandPacketTypeLoaderTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/MySQLCommandPacketTypeLoaderTest.java
index 4c1f3b5e56a..80dcc53e72c 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/MySQLCommandPacketTypeLoaderTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/MySQLCommandPacketTypeLoaderTest.java
@@ -33,7 +33,7 @@ public final class MySQLCommandPacketTypeLoaderTest {
when(payload.readInt1()).thenReturn(0, MySQLCommandPacketType.COM_QUIT.getValue());
assertThat(MySQLCommandPacketTypeLoader.getCommandPacketType(payload), is(MySQLCommandPacketType.COM_QUIT));
}
-
+
@Test(expected = IllegalArgumentException.class)
public void assertGetCommandPacketTypeError() {
MySQLPacketPayload payload = mock(MySQLPacketPayload.class);
diff --git a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/query/binary/execute/MySQLBinaryResultSetRowPacketTest.java b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/query/binary/execute/MySQLBinaryResultSetRowPacketTest.java
index 29902874124..207ab443e96 100644
--- a/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/query/binary/execute/MySQLBinaryResultSetRowPacketTest.java
+++ b/shardingsphere-db-protocol/shardingsphere-db-protocol-mysql/src/test/java/org/apache/shardingsphere/db/protocol/mysql/packet/command/query/binary/execute/MySQLBinaryResultSetRowPacketTest.java
@@ -38,7 +38,7 @@ public final class MySQLBinaryResultSetRowPacketTest {
@Mock
private MySQLPacketPayload payload;
- @Test
+ @Test
public void assertWrite() {
BinaryRow row = new BinaryRow(Arrays.asList(new BinaryCell(MySQLBinaryColumnType.MYSQL_TYPE_STRING, "value"), new BinaryCell(MySQLBinaryColumnType.MYSQL_TYPE_STRING, null)));
MySQLBinaryResultSetRowPacket actual = new MySQLBinaryResultSetRowPacket(1, row);
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/context/EncryptContextBuilderTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/context/EncryptContextBuilderTest.java
index 9c1382c3cd6..068788f7c5c 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/context/EncryptContextBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/context/EncryptContextBuilderTest.java
@@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class EncryptContextBuilderTest {
-
+
@Test
public void assertBuildWhenConfigDateType() {
EncryptContext actual = EncryptContextBuilder.build("encrypt_db", "test", "cipher", mockEncryptRule());
@@ -91,7 +91,7 @@ public final class EncryptContextBuilderTest {
EncryptColumnDataType cipherDataType = new EncryptColumnDataType("varchar(200) not null default ''", dataTypes);
EncryptColumnDataType assistedQueryDataType = new EncryptColumnDataType("varchar(200) not null", dataTypes);
EncryptColumnDataType plainDataType = new EncryptColumnDataType("int(20) unsigned not null default 0", dataTypes);
- return new EncryptColumn(logicDataType, "cipher_certificate_number", cipherDataType, "assisted_certificate_number",
+ return new EncryptColumn(logicDataType, "cipher_certificate_number", cipherDataType, "assisted_certificate_number",
assistedQueryDataType, "certificate_number_plain", plainDataType, "test");
}
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptAlterTableTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptAlterTableTokenGeneratorTest.java
index c43b2608129..fda0ee90b0a 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptAlterTableTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptAlterTableTokenGeneratorTest.java
@@ -135,7 +135,7 @@ public final class EncryptAlterTableTokenGeneratorTest {
when(result.getSqlStatement().getAddColumnDefinitions()).thenReturn(Collections.singletonList(addColumnDefinitionSegment));
return result;
}
-
+
private AlterTableStatementContext buildModifyColumnStatementContext() {
AlterTableStatementContext result = mock(AlterTableStatementContext.class, RETURNS_DEEP_STUBS);
when(result.getSqlStatement().getTable().getTableName().getIdentifier().getValue()).thenReturn("t_encrypt");
@@ -185,7 +185,7 @@ public final class EncryptAlterTableTokenGeneratorTest {
EncryptColumnDataType cipherDataType = new EncryptColumnDataType("varchar(200) not null default ''", dataTypes);
EncryptColumnDataType assistedQueryDataType = new EncryptColumnDataType("varchar(200) not null", dataTypes);
EncryptColumnDataType plainDataType = new EncryptColumnDataType("int(20) unsigned not null default 0", dataTypes);
- return new EncryptColumn(logicDataType, "cipher_certificate_number", cipherDataType,
+ return new EncryptColumn(logicDataType, "cipher_certificate_number", cipherDataType,
"assisted_certificate_number", assistedQueryDataType, "certificate_number_plain", plainDataType, "test");
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptOrderByItemTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptOrderByItemTokenGeneratorTest.java
index 83ab47a453f..b2ff90d34f7 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptOrderByItemTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/impl/EncryptOrderByItemTokenGeneratorTest.java
@@ -48,21 +48,21 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class EncryptOrderByItemTokenGeneratorTest {
-
+
private EncryptOrderByItemTokenGenerator generator;
-
+
@Before
public void setup() {
generator = new EncryptOrderByItemTokenGenerator();
generator.setEncryptRule(buildEncryptRule());
}
-
+
@Test
public void assertGenerateSQLTokens() {
Collection<SubstitutableColumnNameToken> sqlTokens = generator.generateSQLTokens(buildSelectStatementContext());
assertThat(sqlTokens.size(), is(1));
}
-
+
private SelectStatementContext buildSelectStatementContext() {
SimpleTableSegment simpleTableSegment = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("t_encrypt")));
simpleTableSegment.setAlias(new AliasSegment(0, 0, new IdentifierValue("a")));
@@ -77,7 +77,7 @@ public final class EncryptOrderByItemTokenGeneratorTest {
when(result.getTablesContext()).thenReturn(new TablesContext(Collections.singletonList(simpleTableSegment), DatabaseTypeRegistry.getDefaultDatabaseType()));
return result;
}
-
+
private EncryptRule buildEncryptRule() {
EncryptRule result = mock(EncryptRule.class);
EncryptTable encryptTable = mock(EncryptTable.class);
@@ -89,5 +89,4 @@ public final class EncryptOrderByItemTokenGeneratorTest {
when(result.findEncryptTable("t_encrypt")).thenReturn(Optional.of(encryptTable));
return result;
}
-
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptAssignmentTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptAssignmentTokenGeneratorTest.java
index c1571c0babe..b5d4c0ef31d 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptAssignmentTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rewrite/token/EncryptAssignmentTokenGeneratorTest.java
@@ -49,25 +49,25 @@ import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
@RunWith(MockitoJUnitRunner.class)
public final class EncryptAssignmentTokenGeneratorTest {
-
+
private EncryptAssignmentTokenGenerator tokenGenerator;
-
+
private EncryptRule encryptRule;
-
+
private UpdateStatementContext updateStatement;
-
+
private InsertStatementContext insertStatement;
-
+
private AssignmentSegment assignmentSegment;
-
+
private SetAssignmentSegment setAssignmentSegment;
-
+
private LiteralExpressionSegment literalExpression;
-
+
private ParameterMarkerExpressionSegment parameterMarkerExpression;
-
+
private EncryptAlgorithm encryptAlgorithm;
-
+
@Before
public void setup() {
encryptAlgorithm = mock(EncryptAlgorithm.class);
@@ -87,38 +87,38 @@ public final class EncryptAssignmentTokenGeneratorTest {
when(insertStatement.getAllTables().iterator().next().getTableName().getIdentifier().getValue()).thenReturn("table");
when(setAssignmentSegment.getAssignments()).thenReturn(Arrays.asList(assignmentSegment));
}
-
+
@Test
public void assertIsGenerateSQLTokenUpdateSQLSuccess() {
assertTrue(tokenGenerator.isGenerateSQLToken(updateStatement));
}
-
+
@Test
public void assertIsGenerateSQLTokenUpdateSQLFail() {
assertTrue(tokenGenerator.isGenerateSQLToken(insertStatement));
}
-
+
@Test
public void assertGenerateSQLTokenWithUpdateParameterMarkerExpressionSegment() {
when(assignmentSegment.getValue()).thenReturn(parameterMarkerExpression);
Collection<EncryptAssignmentToken> resultCollection = tokenGenerator.generateSQLTokens(updateStatement);
assertThat(resultCollection.size(), is(1));
}
-
+
@Test
public void assertGenerateSQLTokenWithUpdateLiteralExpressionSegment() {
when(assignmentSegment.getValue()).thenReturn(literalExpression);
Collection<EncryptAssignmentToken> resultCollection = tokenGenerator.generateSQLTokens(updateStatement);
assertThat(resultCollection.size(), is(1));
}
-
+
@Test
public void assertGenerateSQLTokenWithUpdateEmpty() {
when(assignmentSegment.getValue()).thenReturn(null);
Collection<EncryptAssignmentToken> resultCollection = tokenGenerator.generateSQLTokens(updateStatement);
assertThat(resultCollection.size(), is(0));
}
-
+
@Test
public void assertGenerateSQLTokenWithInsertLiteralExpressionSegment() {
MockedStatic<InsertStatementHandler> insertStatementHandlerMockedStatic = mockStatic(InsertStatementHandler.class);
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleStatementUpdaterTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleStatementUpdaterTest.java
index dfff58d283e..125ee06aaa4 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleStatementUpdaterTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/update/CreateEncryptRuleStatementUpdaterTest.java
@@ -43,7 +43,7 @@ public final class CreateEncryptRuleStatementUpdaterTest {
@Mock
private ShardingSphereMetaData shardingSphereMetaData;
-
+
private final CreateEncryptRuleStatementUpdater updater = new CreateEncryptRuleStatementUpdater();
static {
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptSpringBootStarterTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptSpringBootStarterTest.java
index 4583ee2769c..616646b0443 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptSpringBootStarterTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/EncryptSpringBootStarterTest.java
@@ -62,14 +62,14 @@ public class EncryptSpringBootStarterTest {
assertThat(encryptRuleConfiguration.getTables().size(), is(1));
assertEncryptTable(encryptRuleConfiguration.getTables().iterator().next());
}
-
+
private void assertEncryptors(final Map<String, EncryptAlgorithm> encryptors) {
assertThat(encryptors.size(), is(2));
assertThat(encryptors.get("aesEncryptor"), instanceOf(AESEncryptAlgorithm.class));
assertThat(encryptors.get("aesEncryptor").getProps().getProperty("aes-key-value"), is("123456"));
assertThat(encryptors.get("md5Encryptor"), instanceOf(MD5EncryptAlgorithm.class));
}
-
+
private void assertEncryptTable(final EncryptTableRuleConfiguration tableRuleConfig) {
assertThat(tableRuleConfig.getName(), is("t_order"));
assertThat(tableRuleConfig.getColumns().size(), is(2));
@@ -78,13 +78,13 @@ public class EncryptSpringBootStarterTest {
assertEncryptColumn2(columnRuleConfigs.next());
assertEncryptColumn1(columnRuleConfigs.next());
}
-
+
private void assertEncryptColumn1(final EncryptColumnRuleConfiguration columnRuleConfig) {
assertThat(columnRuleConfig.getLogicColumn(), is("pwd"));
assertThat(columnRuleConfig.getCipherColumn(), is("pwd_cipher"));
assertThat(columnRuleConfig.getEncryptorName(), is("aesEncryptor"));
}
-
+
private void assertEncryptColumn2(final EncryptColumnRuleConfiguration columnRuleConfig) {
assertThat(columnRuleConfig.getLogicColumn(), is("credit_card"));
assertThat(columnRuleConfig.getCipherColumn(), is("credit_card_cipher"));
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/condition/EncryptSpringBootConditionTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/condition/EncryptSpringBootConditionTest.java
index 5dcf986bd85..703f28c7fd9 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/condition/EncryptSpringBootConditionTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-boot-starter/src/test/java/org/apache/shardingsphere/encrypt/spring/boot/condition/EncryptSpringBootConditionTest.java
@@ -57,4 +57,3 @@ public final class EncryptSpringBootConditionTest {
assertFalse(matchOutcome.isMatch());
}
}
-
diff --git a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/ReadWriteSplittingDataSourceRuleConfigurationTest.java b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/ReadWriteSplittingDataSourceRuleConfigurationTest.java
index 852b81231ce..58633681d68 100644
--- a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/ReadWriteSplittingDataSourceRuleConfigurationTest.java
+++ b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/ReadWriteSplittingDataSourceRuleConfigurationTest.java
@@ -28,32 +28,32 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
public final class ReadWriteSplittingDataSourceRuleConfigurationTest {
-
+
private ReadwriteSplittingDataSourceRuleConfiguration readwriteSplittingDataSourceRuleConfig;
-
+
private ReadwriteSplittingDataSourceRuleConfiguration readwriteSplittingDataSourceRuleConfigDynamic;
-
+
@Before
public void setup() {
readwriteSplittingDataSourceRuleConfig = new ReadwriteSplittingDataSourceRuleConfiguration("ds", "Static", getProperties("write_ds", "read_ds_0,read_ds_1"), "");
readwriteSplittingDataSourceRuleConfigDynamic = new ReadwriteSplittingDataSourceRuleConfiguration("ds", "Dynamic", getProperties("write_ds", "read_ds_0,read_ds_1"), "");
}
-
+
@Test
public void assertGetAutoAwareDataSourceName() {
assertNull(readwriteSplittingDataSourceRuleConfigDynamic.getProps().getProperty("auto-aware-data-source-name"));
}
-
+
@Test
public void assertGetWriteDataSourceName() {
assertThat(readwriteSplittingDataSourceRuleConfig.getProps().getProperty("write-data-source-name"), is("write_ds"));
}
-
+
@Test
public void assertGetReadDataSourceNames() {
assertThat(readwriteSplittingDataSourceRuleConfig.getProps().getProperty("read-data-source-names"), is("read_ds_0,read_ds_1"));
}
-
+
private Properties getProperties(final String writeDataSource, final String readDataSources) {
Properties result = new Properties();
result.setProperty("write-data-source-name", writeDataSource);
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/determiner/HintShadowAlgorithmDeterminerTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/determiner/HintShadowAlgorithmDeterminerTest.java
index 82c7854f836..7d0f8b55a14 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/determiner/HintShadowAlgorithmDeterminerTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/determiner/HintShadowAlgorithmDeterminerTest.java
@@ -62,19 +62,19 @@ public final class HintShadowAlgorithmDeterminerTest {
result.setShadowAlgorithms(createShadowAlgorithms());
return result;
}
-
+
private Map<String, ShadowAlgorithm> createShadowAlgorithms() {
Map<String, ShadowAlgorithm> result = new LinkedHashMap<>();
result.put("simple-hint-algorithm", createHintShadowAlgorithm());
return result;
}
-
+
private Map<String, ShadowTableConfiguration> createTables() {
Map<String, ShadowTableConfiguration> result = new LinkedHashMap<>();
result.put("t_order", new ShadowTableConfiguration(Collections.singletonList("shadow-data-source-0"), createShadowAlgorithmNames()));
return result;
}
-
+
private Collection<String> createShadowAlgorithmNames() {
Collection<String> result = new LinkedList<>();
result.add("simple-hint-algorithm");
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/dml/ShadowSelectStatementRoutingEngineTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/dml/ShadowSelectStatementRoutingEngineTest.java
index 414a20fc2b0..6ac98ad2b21 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/dml/ShadowSelectStatementRoutingEngineTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/dml/ShadowSelectStatementRoutingEngineTest.java
@@ -93,7 +93,7 @@ public final class ShadowSelectStatementRoutingEngineTest {
assertThat(sqlNotesIt.next(), is("/*shadow:true,foo:bar*/"));
assertThat(sqlNotesIt.next(), is("/*aaa:bbb*/"));
}
-
+
private AlgorithmProvidedShadowRuleConfiguration createAlgorithmProvidedShadowRuleConfiguration() {
AlgorithmProvidedShadowRuleConfiguration result = new AlgorithmProvidedShadowRuleConfiguration();
result.setDataSources(createDataSources());
@@ -101,13 +101,13 @@ public final class ShadowSelectStatementRoutingEngineTest {
result.setShadowAlgorithms(createShadowAlgorithms());
return result;
}
-
+
private Map<String, ShadowAlgorithm> createShadowAlgorithms() {
Map<String, ShadowAlgorithm> result = new LinkedHashMap<>();
result.put("user-id-select-regex-algorithm", createColumnShadowAlgorithm());
return result;
}
-
+
private ShadowAlgorithm createColumnShadowAlgorithm() {
Properties properties = new Properties();
properties.setProperty("column", "user_id");
@@ -118,7 +118,7 @@ public final class ShadowSelectStatementRoutingEngineTest {
columnRegexMatchShadowAlgorithm.init();
return columnRegexMatchShadowAlgorithm;
}
-
+
private Map<String, ShadowTableConfiguration> createTables() {
Map<String, ShadowTableConfiguration> result = new LinkedHashMap<>();
Collection<String> shadowAlgorithmNames = new LinkedList<>();
@@ -126,7 +126,7 @@ public final class ShadowSelectStatementRoutingEngineTest {
result.put("t_order", new ShadowTableConfiguration(Collections.singletonList("shadow-data-source-0"), shadowAlgorithmNames));
return result;
}
-
+
private Map<String, ShadowDataSourceConfiguration> createDataSources() {
Map<String, ShadowDataSourceConfiguration> result = new LinkedHashMap<>();
result.put("shadow-data-source-0", new ShadowDataSourceConfiguration("ds", "ds_shadow"));
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/dml/ShadowUpdateStatementRoutingEngineTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/dml/ShadowUpdateStatementRoutingEngineTest.java
index f507a256ec7..82e57e649c1 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/dml/ShadowUpdateStatementRoutingEngineTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/dml/ShadowUpdateStatementRoutingEngineTest.java
@@ -92,7 +92,7 @@ public final class ShadowUpdateStatementRoutingEngineTest {
assertThat(sqlNotesIt.next(), is("/*shadow:true,foo:bar*/"));
assertThat(sqlNotesIt.next(), is("/*aaa:bbb*/"));
}
-
+
private AlgorithmProvidedShadowRuleConfiguration createAlgorithmProvidedShadowRuleConfiguration() {
AlgorithmProvidedShadowRuleConfiguration result = new AlgorithmProvidedShadowRuleConfiguration();
result.setDataSources(createDataSources());
@@ -100,13 +100,13 @@ public final class ShadowUpdateStatementRoutingEngineTest {
result.setShadowAlgorithms(createShadowAlgorithms());
return result;
}
-
+
private Map<String, ShadowAlgorithm> createShadowAlgorithms() {
Map<String, ShadowAlgorithm> result = new LinkedHashMap<>();
result.put("user-id-update-regex-algorithm", createColumnShadowAlgorithm());
return result;
}
-
+
private ShadowAlgorithm createColumnShadowAlgorithm() {
Properties properties = new Properties();
properties.setProperty("column", "user_id");
@@ -117,7 +117,7 @@ public final class ShadowUpdateStatementRoutingEngineTest {
columnRegexMatchShadowAlgorithm.init();
return columnRegexMatchShadowAlgorithm;
}
-
+
private Map<String, ShadowTableConfiguration> createTables() {
Map<String, ShadowTableConfiguration> result = new LinkedHashMap<>();
Collection<String> shadowAlgorithmNames = new LinkedList<>();
@@ -125,7 +125,7 @@ public final class ShadowUpdateStatementRoutingEngineTest {
result.put("t_order", new ShadowTableConfiguration(Collections.singletonList("shadow-data-source-0"), shadowAlgorithmNames));
return result;
}
-
+
private Map<String, ShadowDataSourceConfiguration> createDataSources() {
Map<String, ShadowDataSourceConfiguration> result = new LinkedHashMap<>();
result.put("shadow-data-source-0", new ShadowDataSourceConfiguration("ds", "ds_shadow"));
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/util/ShadowExtractorTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/util/ShadowExtractorTest.java
index 8a5342541c0..a812b215899 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/util/ShadowExtractorTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/util/ShadowExtractorTest.java
@@ -29,7 +29,7 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public final class ShadowExtractorTest {
-
+
@Test
public void assertExtractValuesSimpleExpressionSegment() {
SimpleExpressionSegment simpleExpressionSegment = new LiteralExpressionSegment(1, 2, "expected");
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/datasource/ShadowDataSourcePropertiesYamlSwapperTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/datasource/ShadowDataSourcePropertiesYamlSwapperTest.java
index 97f18d49f76..8770c93b801 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/datasource/ShadowDataSourcePropertiesYamlSwapperTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/datasource/ShadowDataSourcePropertiesYamlSwapperTest.java
@@ -25,7 +25,7 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public final class ShadowDataSourcePropertiesYamlSwapperTest {
-
+
@Test
public void assertSwapToYamlConfiguration() {
ShadowDataSourceConfiguration shadowDataSourceConfiguration = new ShadowDataSourceConfiguration("ds", "ds-shadow");
@@ -34,7 +34,7 @@ public final class ShadowDataSourcePropertiesYamlSwapperTest {
assertThat(shadowDataSourceConfiguration.getSourceDataSourceName(), is(configuration.getSourceDataSourceName()));
assertThat(shadowDataSourceConfiguration.getShadowDataSourceName(), is(configuration.getShadowDataSourceName()));
}
-
+
@Test
public void assertSwapToObject() {
YamlShadowDataSourceConfiguration yamlConfiguration = new YamlShadowDataSourceConfiguration();
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/table/ShadowTableConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/table/ShadowTableConfigurationYamlSwapperTest.java
index f28a8619eac..9e57decec84 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/table/ShadowTableConfigurationYamlSwapperTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/table/ShadowTableConfigurationYamlSwapperTest.java
@@ -37,7 +37,7 @@ public final class ShadowTableConfigurationYamlSwapperTest {
assertThat(yamlShadowTableConfiguration.getShadowAlgorithmNames(), is(shadowTableConfiguration.getShadowAlgorithmNames()));
assertThat(yamlShadowTableConfiguration.getDataSourceNames(), is(shadowTableConfiguration.getDataSourceNames()));
}
-
+
@Test
public void assertSwapToObject() {
YamlShadowTableConfiguration yamlConfig = new YamlShadowTableConfiguration();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithmTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithmTest.java
index 196c757d5c3..fe69f2a9c2a 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithmTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithmTest.java
@@ -131,73 +131,73 @@ public final class IntervalShardingAlgorithmTest {
@Test
public void assertPreciseDoShardingByQuarter() {
- assertThat(shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
+ assertThat(shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
new PreciseShardingValue<>("t_order", "create_time", DATA_NODE_INFO, "2020-01-01 00:00:01")), is("t_order_202001"));
- assertThat(shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
+ assertThat(shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
new PreciseShardingValue<>("t_order", "create_time", DATA_NODE_INFO, "2020-02-01 00:00:01")), is("t_order_202001"));
}
@Test
public void assertRangeDoShardingByQuarter() {
- Collection<String> actual = shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
+ Collection<String> actual = shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO, Range.closed("2019-10-15 10:59:08", "2020-04-08 10:59:08")));
assertThat(actual.size(), is(3));
}
@Test
public void assertPreciseDoShardingByMonth() {
- assertThat(shardingAlgorithmByMonth.doSharding(availableTablesForMonthDataSources,
+ assertThat(shardingAlgorithmByMonth.doSharding(availableTablesForMonthDataSources,
new PreciseShardingValue<>("t_order", "create_time", DATA_NODE_INFO, "2020-01-01 00:00:01")), is("t_order_202001"));
- assertNull(shardingAlgorithmByMonth.doSharding(availableTablesForMonthDataSources,
+ assertNull(shardingAlgorithmByMonth.doSharding(availableTablesForMonthDataSources,
new PreciseShardingValue<>("t_order", "create_time", DATA_NODE_INFO, "2030-01-01 00:00:01")));
}
@Test
public void assertRangeDoShardingByMonth() {
- Collection<String> actual = shardingAlgorithmByMonth.doSharding(availableTablesForMonthDataSources,
+ Collection<String> actual = shardingAlgorithmByMonth.doSharding(availableTablesForMonthDataSources,
new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO, Range.closed("2019-10-15 10:59:08", "2020-04-08 10:59:08")));
assertThat(actual.size(), is(7));
}
@Test
public void assertLowerHalfRangeDoSharding() {
- Collection<String> actual = shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
+ Collection<String> actual = shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO, Range.atLeast("2018-10-15 10:59:08")));
assertThat(actual.size(), is(9));
}
@Test
public void assertUpperHalfRangeDoSharding() {
- Collection<String> actual = shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
+ Collection<String> actual = shardingAlgorithmByQuarter.doSharding(availableTablesForQuarterDataSources,
new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO, Range.atMost("2019-09-01 00:00:00")));
assertThat(actual.size(), is(15));
}
@Test
public void assertLowerHalfRangeDoShardingByDay() {
- Collection<String> actual = shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
+ Collection<String> actual = shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO, Range.atLeast("2021-01-01 00:00:00")));
assertThat(actual.size(), is(31));
}
@Test
public void assertUpperHalfRangeDoShardingByDay() {
- Collection<String> actual = shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
+ Collection<String> actual = shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO, Range.atMost("2021-07-31 01:00:00")));
assertThat(actual.size(), is(31));
}
@Test
public void assertPreciseDoShardingByDay() {
- assertThat(shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
+ assertThat(shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
new PreciseShardingValue<>("t_order", "create_time", DATA_NODE_INFO, "2021-07-01 00:00:01")), is("t_order_20210701"));
- assertThat(shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
+ assertThat(shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
new PreciseShardingValue<>("t_order", "create_time", DATA_NODE_INFO, "2021-07-02 00:00:01")), is("t_order_20210701"));
}
@Test
public void assertRangeDoShardingByDay() {
- Collection<String> actual = shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
+ Collection<String> actual = shardingAlgorithmByDay.doSharding(availableTablesForDayDataSources,
new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO, Range.closed("2021-06-15 00:00:00", "2021-07-31 01:00:00")));
assertThat(actual.size(), is(24));
}
@@ -214,7 +214,7 @@ public final class IntervalShardingAlgorithmTest {
assertThat(tableNameShardedByQuarter, is("202004"));
assertThat(tableNameShardedByMonth, is("202010"));
}
-
+
@Test
public void assertLocalDateTimeWithZeroMillisecond() {
Collection<String> actual = shardingAlgorithmByDayWithMillisecond.doSharding(availableTablesForDayWithMillisecondDataSources,
@@ -222,7 +222,7 @@ public final class IntervalShardingAlgorithmTest {
Range.closed(LocalDateTime.of(2021, 6, 15, 2, 25, 27), LocalDateTime.of(2021, 7, 31, 2, 25, 27))));
assertThat(actual.size(), is(24));
}
-
+
@Test
@SneakyThrows(ParseException.class)
public void assertDateWithZeroMillisecond() {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineExpressionParserTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineExpressionParserTest.java
index bd1cafc5197..84efc82e4e0 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineExpressionParserTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineExpressionParserTest.java
@@ -108,7 +108,7 @@ public final class InlineExpressionParserTest {
assertThat(expected.size(), is(1024));
assertThat(expected, hasItems("ds_0.t_user_0", "ds_15.t_user_1023"));
}
-
+
@Test
public void assertValidInlineExpression() {
boolean actualExpression1 = InlineExpressionParser.isInlineExpression("t_$->{\"new_order1\"}");
@@ -116,13 +116,13 @@ public final class InlineExpressionParserTest {
assertThat(actualExpression1, is(true));
assertThat(actualExpression2, is(true));
}
-
+
@Test
public void assertInValidInLineExpression() {
boolean actualExpression1 = InlineExpressionParser.isInlineExpression("t_>{\"new_order1\"}");
assertThat(actualExpression1, is(false));
}
-
+
@Test
public void assertHandlePlaceHolder() {
String actualExpression1 = InlineExpressionParser.handlePlaceHolder("t_$->{[\"new$->{1+2}\"]}");
@@ -130,7 +130,7 @@ public final class InlineExpressionParserTest {
assertThat(actualExpression1, is("t_${[\"new${1+2}\"]}"));
assertThat(actualExpression2, is("t_${[\"new${1+2}\"]}"));
}
-
+
@Test
public void assertEvaluateClosure() {
Closure<?> closure = new InlineExpressionParser("${1+2}").evaluateClosure();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedComplexKeysShardingAlgorithmFixture.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedComplexKeysShardingAlgorithmFixture.java
index 5dc271add97..b5419ae358e 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedComplexKeysShardingAlgorithmFixture.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedComplexKeysShardingAlgorithmFixture.java
@@ -23,16 +23,16 @@ import org.apache.shardingsphere.sharding.api.sharding.complex.ComplexKeysShardi
import java.util.Collection;
public final class ClassBasedComplexKeysShardingAlgorithmFixture implements ComplexKeysShardingAlgorithm<Integer> {
-
+
@Override
public void init() {
}
-
+
@Override
public Collection<String> doSharding(final Collection<String> availableTargetNames, final ComplexKeysShardingValue<Integer> shardingValue) {
return availableTargetNames;
}
-
+
@Override
public String getType() {
return null;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedHintShardingAlgorithmFixture.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedHintShardingAlgorithmFixture.java
index 1cc24dfccce..671dec14b29 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedHintShardingAlgorithmFixture.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedHintShardingAlgorithmFixture.java
@@ -23,16 +23,16 @@ import org.apache.shardingsphere.sharding.api.sharding.hint.HintShardingValue;
import java.util.Collection;
public final class ClassBasedHintShardingAlgorithmFixture implements HintShardingAlgorithm<Integer> {
-
+
@Override
public void init() {
}
-
+
@Override
public Collection<String> doSharding(final Collection<String> availableTargetNames, final HintShardingValue<Integer> shardingValue) {
return availableTargetNames;
}
-
+
@Override
public String getType() {
return null;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedStandardShardingAlgorithmFixture.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedStandardShardingAlgorithmFixture.java
index 15422067bf4..d427f981158 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedStandardShardingAlgorithmFixture.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/fixture/ClassBasedStandardShardingAlgorithmFixture.java
@@ -24,11 +24,11 @@ import org.apache.shardingsphere.sharding.api.sharding.standard.StandardSharding
import java.util.Collection;
public final class ClassBasedStandardShardingAlgorithmFixture implements StandardShardingAlgorithm<Integer> {
-
+
@Override
public void init() {
}
-
+
@Override
public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Integer> shardingValue) {
for (String each : availableTargetNames) {
@@ -38,12 +38,12 @@ public final class ClassBasedStandardShardingAlgorithmFixture implements Standar
}
return null;
}
-
+
@Override
public Collection<String> doSharding(final Collection<String> availableTargetNames, final RangeShardingValue<Integer> shardingValue) {
return availableTargetNames;
}
-
+
@Override
public String getType() {
return null;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java
index 785afe43a0a..d74f7a1fa09 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java
@@ -55,27 +55,27 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ShardingResultMergerEngineTest {
-
+
@Test
public void assertNewInstanceWithSelectStatementForMySQL() {
assertNewInstanceWithSelectStatement(new MySQLSelectStatement());
}
-
+
@Test
public void assertNewInstanceWithSelectStatementForOracle() {
assertNewInstanceWithSelectStatement(new OracleSelectStatement());
}
-
+
@Test
public void assertNewInstanceWithSelectStatementForPostgreSQL() {
assertNewInstanceWithSelectStatement(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertNewInstanceWithSelectStatementForSQL92() {
assertNewInstanceWithSelectStatement(new SQL92SelectStatement());
}
-
+
@Test
public void assertNewInstanceWithSelectStatementForSQLServer() {
assertNewInstanceWithSelectStatement(new SQLServerSelectStatement());
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
index 0dee05c89b7..688400a9dd8 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
@@ -126,7 +126,7 @@ public final class GroupByMemoryMergedResultTest {
selectStatement.setProjections(projectionsSegment);
return new SelectStatementContext(Collections.singletonMap(DefaultSchema.LOGIC_NAME, metaData), Collections.emptyList(), selectStatement, DefaultSchema.LOGIC_NAME);
}
-
+
@Test
public void assertNextForAggregationResultSetsEmpty() throws SQLException {
QueryResult queryResult1 = createQueryResult();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java
index 831a4ee67d9..657da667347 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByRowComparatorTest.java
@@ -53,27 +53,27 @@ import static org.mockito.Mockito.when;
public final class GroupByRowComparatorTest {
private final List<Boolean> caseSensitives = Arrays.asList(false, false, false);
-
+
@Test
public void assertCompareToForAscWithOrderByItemsForMySQL() throws SQLException {
assertCompareToForAscWithOrderByItems(new MySQLSelectStatement());
}
-
+
@Test
public void assertCompareToForAscWithOrderByItemsForOracle() throws SQLException {
assertCompareToForAscWithOrderByItems(new OracleSelectStatement());
}
-
+
@Test
public void assertCompareToForAscWithOrderByItemsForPostgreSQL() throws SQLException {
assertCompareToForAscWithOrderByItems(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCompareToForAscWithOrderByItemsForSQL92() throws SQLException {
assertCompareToForAscWithOrderByItems(new SQL92SelectStatement());
}
-
+
@Test
public void assertCompareToForAscWithOrderByItemsForSQLServer() throws SQLException {
assertCompareToForAscWithOrderByItems(new SQLServerSelectStatement());
@@ -97,27 +97,27 @@ public final class GroupByRowComparatorTest {
MemoryQueryResultRow o2 = new MemoryQueryResultRow(mockQueryResult("3", "4"));
assertTrue(groupByRowComparator.compare(o1, o2) < 0);
}
-
+
@Test
public void assertCompareToForDecsWithOrderByItemsForMySQL() throws SQLException {
assertCompareToForDecsWithOrderByItems(new MySQLSelectStatement());
}
-
+
@Test
public void assertCompareToForDecsWithOrderByItemsForOracle() throws SQLException {
assertCompareToForDecsWithOrderByItems(new OracleSelectStatement());
}
-
+
@Test
public void assertCompareToForDecsWithOrderByItemsForPostgreSQL() throws SQLException {
assertCompareToForDecsWithOrderByItems(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCompareToForDecsWithOrderByItemsForSQL92() throws SQLException {
assertCompareToForDecsWithOrderByItems(new SQL92SelectStatement());
}
-
+
@Test
public void assertCompareToForDecsWithOrderByItemsForSQLServer() throws SQLException {
assertCompareToForDecsWithOrderByItems(new SQLServerSelectStatement());
@@ -141,27 +141,27 @@ public final class GroupByRowComparatorTest {
MemoryQueryResultRow o2 = new MemoryQueryResultRow(mockQueryResult("3", "4"));
assertTrue(groupByRowComparator.compare(o1, o2) > 0);
}
-
+
@Test
public void assertCompareToForEqualWithOrderByItemsForMySQL() throws SQLException {
assertCompareToForEqualWithOrderByItems(new MySQLSelectStatement());
}
-
+
@Test
public void assertCompareToForEqualWithOrderByItemsForOracle() throws SQLException {
assertCompareToForEqualWithOrderByItems(new OracleSelectStatement());
}
-
+
@Test
public void assertCompareToForEqualWithOrderByItemsForPostgreSQL() throws SQLException {
assertCompareToForEqualWithOrderByItems(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCompareToForEqualWithOrderByItemsForSQL92() throws SQLException {
assertCompareToForEqualWithOrderByItems(new SQL92SelectStatement());
}
-
+
@Test
public void assertCompareToForEqualWithOrderByItemsForSQLServer() throws SQLException {
assertCompareToForEqualWithOrderByItems(new SQLServerSelectStatement());
@@ -185,27 +185,27 @@ public final class GroupByRowComparatorTest {
MemoryQueryResultRow o2 = new MemoryQueryResultRow(mockQueryResult("1", "2"));
assertThat(groupByRowComparator.compare(o1, o2), is(0));
}
-
+
@Test
public void assertCompareToForAscWithGroupByItemsForMySQL() throws SQLException {
assertCompareToForAscWithGroupByItems(new MySQLSelectStatement());
}
-
+
@Test
public void assertCompareToForAscWithGroupByItemsForOracle() throws SQLException {
assertCompareToForAscWithGroupByItems(new OracleSelectStatement());
}
-
+
@Test
public void assertCompareToForAscWithGroupByItemsForPostgreSQL() throws SQLException {
assertCompareToForAscWithGroupByItems(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCompareToForAscWithGroupByItemsForSQL92() throws SQLException {
assertCompareToForAscWithGroupByItems(new SQL92SelectStatement());
}
-
+
@Test
public void assertCompareToForAscWithGroupByItemsForSQLServer() throws SQLException {
assertCompareToForAscWithGroupByItems(new SQLServerSelectStatement());
@@ -226,27 +226,27 @@ public final class GroupByRowComparatorTest {
MemoryQueryResultRow o2 = new MemoryQueryResultRow(mockQueryResult("3", "4"));
assertTrue(groupByRowComparator.compare(o1, o2) < 0);
}
-
+
@Test
public void assertCompareToForDecsWithGroupByItemsForMySQL() throws SQLException {
assertCompareToForDecsWithGroupByItems(new MySQLSelectStatement());
}
-
+
@Test
public void assertCompareToForDecsWithGroupByItemsForOracle() throws SQLException {
assertCompareToForDecsWithGroupByItems(new OracleSelectStatement());
}
-
+
@Test
public void assertCompareToForDecsWithGroupByItemsForPostgreSQL() throws SQLException {
assertCompareToForDecsWithGroupByItems(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCompareToForDecsWithGroupByItemsForSQL92() throws SQLException {
assertCompareToForDecsWithGroupByItems(new SQL92SelectStatement());
}
-
+
@Test
public void assertCompareToForDecsWithGroupByItemsForSQLServer() throws SQLException {
assertCompareToForDecsWithGroupByItems(new SQLServerSelectStatement());
@@ -267,27 +267,27 @@ public final class GroupByRowComparatorTest {
MemoryQueryResultRow o2 = new MemoryQueryResultRow(mockQueryResult("3", "4"));
assertTrue(groupByRowComparator.compare(o1, o2) > 0);
}
-
+
@Test
public void assertCompareToForEqualWithGroupByItemsForMySQL() throws SQLException {
assertCompareToForEqualWithGroupByItems(new MySQLSelectStatement());
}
-
+
@Test
public void assertCompareToForEqualWithGroupByItemsForOracle() throws SQLException {
assertCompareToForEqualWithGroupByItems(new OracleSelectStatement());
}
-
+
@Test
public void assertCompareToForEqualWithGroupByItemsForPostgreSQL() throws SQLException {
assertCompareToForEqualWithGroupByItems(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCompareToForEqualWithGroupByItemsForSQL92() throws SQLException {
assertCompareToForEqualWithGroupByItems(new SQL92SelectStatement());
}
-
+
@Test
public void assertCompareToForEqualWithGroupByItemsForSQLServer() throws SQLException {
assertCompareToForEqualWithGroupByItems(new SQLServerSelectStatement());
@@ -308,7 +308,7 @@ public final class GroupByRowComparatorTest {
MemoryQueryResultRow o2 = new MemoryQueryResultRow(mockQueryResult("1", "2"));
assertThat(groupByRowComparator.compare(o1, o2), is(0));
}
-
+
private QueryResult mockQueryResult(final Object... values) throws SQLException {
ResultSet resultSet = mock(ResultSet.class);
ResultSetMetaData resultSetMetaData = mock(ResultSetMetaData.class);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java
index 56ccca72aaa..55e309e1bc5 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByValueTest.java
@@ -53,27 +53,27 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class OrderByValueTest {
-
+
@Test
public void assertCompareToForAscForMySQL() throws SQLException, NoSuchFieldException {
- assertCompareToForAsc(new MySQLSelectStatement());
+ assertCompareToForAsc(new MySQLSelectStatement());
}
-
+
@Test
public void assertCompareToForAscForOracle() throws SQLException, NoSuchFieldException {
assertCompareToForAsc(new OracleSelectStatement());
}
-
+
@Test
public void assertCompareToForAscForPostgreSQL() throws SQLException, NoSuchFieldException {
assertCompareToForAsc(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCompareToForAscForSQL92() throws SQLException, NoSuchFieldException {
assertCompareToForAsc(new SQL92SelectStatement());
}
-
+
@Test
public void assertCompareToForAscForSQLServer() throws SQLException, NoSuchFieldException {
assertCompareToForAsc(new SQLServerSelectStatement());
@@ -105,27 +105,27 @@ public final class OrderByValueTest {
assertFalse(orderByValue1.getQueryResult().next());
assertFalse(orderByValue2.getQueryResult().next());
}
-
+
@Test
public void assertCompareToForDescForMySQL() throws SQLException, NoSuchFieldException {
assertCompareToForDesc(new MySQLSelectStatement());
}
-
+
@Test
public void assertCompareToForDescForOracle() throws SQLException, NoSuchFieldException {
assertCompareToForDesc(new OracleSelectStatement());
}
-
+
@Test
public void assertCompareToForDescForPostgreSQL() throws SQLException, NoSuchFieldException {
assertCompareToForDesc(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCompareToForDescForSQL92() throws SQLException, NoSuchFieldException {
assertCompareToForDesc(new SQL92SelectStatement());
}
-
+
@Test
public void assertCompareToForDescForSQLServer() throws SQLException, NoSuchFieldException {
assertCompareToForDesc(new SQLServerSelectStatement());
@@ -158,27 +158,27 @@ public final class OrderByValueTest {
assertFalse(orderByValue1.getQueryResult().next());
assertFalse(orderByValue2.getQueryResult().next());
}
-
+
@Test
public void assertCompareToWhenEqualForMySQL() throws SQLException, NoSuchFieldException {
assertCompareToWhenEqual(new MySQLSelectStatement());
}
-
+
@Test
public void assertCompareToWhenEqualForOracle() throws SQLException, NoSuchFieldException {
assertCompareToWhenEqual(new OracleSelectStatement());
}
-
+
@Test
public void assertCompareToWhenEqualForPostgreSQL() throws SQLException, NoSuchFieldException {
assertCompareToWhenEqual(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCompareToWhenEqualForSQL92() throws SQLException, NoSuchFieldException {
assertCompareToWhenEqual(new SQL92SelectStatement());
}
-
+
@Test
public void assertCompareToWhenEqualForSQLServer() throws SQLException, NoSuchFieldException {
assertCompareToWhenEqual(new SQLServerSelectStatement());
@@ -225,7 +225,7 @@ public final class OrderByValueTest {
result.setIndex(indexOrderByItemSegment.getColumnIndex());
return result;
}
-
+
private OrderBySegment createOrderBySegment() {
OrderByItemSegment orderByItemSegment = new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("id")), OrderDirection.ASC, OrderDirection.ASC);
return new OrderBySegment(0, 0, Collections.singletonList(orderByItemSegment));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java
index 519541d00c0..c43da8be542 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java
@@ -44,9 +44,9 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class TopAndRowNumberDecoratorMergedResultTest {
-
+
private ShardingSphereSchema schema;
-
+
@Before
public void setUp() {
schema = mock(ShardingSphereSchema.class);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/context/ShardingSQLRewriteContextDecoratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/context/ShardingSQLRewriteContextDecoratorTest.java
index 9d61b9efdc7..5b95171a6c7 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/context/ShardingSQLRewriteContextDecoratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/context/ShardingSQLRewriteContextDecoratorTest.java
@@ -35,7 +35,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ShardingSQLRewriteContextDecoratorTest {
-
+
@Test
public void assertDecorateForRouteContextWhenIsFederated() {
ShardingSQLRewriteContextDecorator shardingSQLRewriteContextDecorator = new ShardingSQLRewriteContextDecorator();
@@ -51,7 +51,7 @@ public final class ShardingSQLRewriteContextDecoratorTest {
assertTrue(Objects.isNull(sqlRewriteContext.getParameterBuilder()));
assertThat(sqlRewriteContext.getSqlTokens().size(), is(0));
}
-
+
@Test
public void assertDecorateForRouteContextWhenNotFederated() {
List<Object> dummy = new ArrayList<>();
@@ -66,14 +66,14 @@ public final class ShardingSQLRewriteContextDecoratorTest {
shardingSQLRewriteContextDecorator.decorate(shardingRule, configurationProperties, sqlRewriteContext, routeContext);
assertTrue(Objects.nonNull(sqlRewriteContext.getSqlTokens()));
}
-
+
@Test
public void assertGetOrder() {
ShardingSQLRewriteContextDecorator shardingSQLRewriteContextDecorator = new ShardingSQLRewriteContextDecorator();
int actual = shardingSQLRewriteContextDecorator.getOrder();
assertThat(actual, is(ShardingOrder.ORDER));
}
-
+
@Test
public void assertGetTypeClass() {
ShardingSQLRewriteContextDecorator shardingSQLRewriteContextDecorator = new ShardingSQLRewriteContextDecorator();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameter/ShardingPaginationParameterRewriterTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameter/ShardingPaginationParameterRewriterTest.java
index 982bd4984bb..9875048a1b2 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameter/ShardingPaginationParameterRewriterTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameter/ShardingPaginationParameterRewriterTest.java
@@ -38,19 +38,19 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ShardingPaginationParameterRewriterTest {
-
+
private static final int TEST_OFFSET_PARAMETER_INDEX = 3;
-
+
private static final int TEST_ROW_COUNT_PARAMETER_INDEX = 5;
-
+
private static final long TEST_REVISED_OFFSET = 4;
-
+
private static final long TEST_REVISED_ROW_COUNT = 6;
-
+
private static boolean addOffsetParametersFlag = Boolean.FALSE;
-
+
private static boolean addRowCountParameterFlag = Boolean.FALSE;
-
+
@Test
public void assertIsNeedRewrite() {
ShardingPaginationParameterRewriter shardingPaginationParameterRewriter = new ShardingPaginationParameterRewriter();
@@ -67,7 +67,7 @@ public final class ShardingPaginationParameterRewriterTest {
when(routeContext.isSingleRouting()).thenReturn(Boolean.FALSE);
assertTrue(shardingPaginationParameterRewriter.isNeedRewrite(selectStatementContext));
}
-
+
@Test
public void assertRewrite() {
addOffsetParametersFlag = false;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/AggregationDistinctTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/AggregationDistinctTokenGeneratorTest.java
index e6bb0cfb98c..14267d9fcd5 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/AggregationDistinctTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/AggregationDistinctTokenGeneratorTest.java
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class AggregationDistinctTokenGeneratorTest {
-
+
@Test
public void assertIsGenerateSQLToken() {
AggregationDistinctTokenGenerator aggregationDistinctTokenGenerator = new AggregationDistinctTokenGenerator();
@@ -47,7 +47,7 @@ public final class AggregationDistinctTokenGeneratorTest {
InsertStatementContext insertStatementContext = mock(InsertStatementContext.class);
assertFalse(aggregationDistinctTokenGenerator.isGenerateSQLToken(insertStatementContext));
}
-
+
@Test
public void assertGenerateSQLToken() {
AggregationDistinctProjection aggregationDistinctProjection = mock(AggregationDistinctProjection.class);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ConstraintTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ConstraintTokenGeneratorTest.java
index 5d0b05237b8..092df618ee9 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ConstraintTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ConstraintTokenGeneratorTest.java
@@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ConstraintTokenGeneratorTest {
-
+
@Test
public void assertIsGenerateSQLToken() {
CreateDatabaseStatementContext createDatabaseStatementContext = mock(CreateDatabaseStatementContext.class);
@@ -50,7 +50,7 @@ public final class ConstraintTokenGeneratorTest {
constraintSegmentCollection.add(mock(ConstraintSegment.class));
assertTrue(constraintTokenGenerator.isGenerateSQLToken(alterTableStatementContext));
}
-
+
@Test
public void assertGenerateSQLTokens() {
ConstraintSegment constraintSegment = mock(ConstraintSegment.class);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/DistinctProjectionPrefixTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/DistinctProjectionPrefixTokenGeneratorTest.java
index 37b5cfa23cf..249f12cd1f9 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/DistinctProjectionPrefixTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/DistinctProjectionPrefixTokenGeneratorTest.java
@@ -36,7 +36,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class DistinctProjectionPrefixTokenGeneratorTest {
-
+
@Test
public void assertIsGenerateSQLToken() {
CreateDatabaseStatementContext createDatabaseStatementContext = mock(CreateDatabaseStatementContext.class);
@@ -49,7 +49,7 @@ public final class DistinctProjectionPrefixTokenGeneratorTest {
aggregationDistinctProjectionList.add(mock(AggregationDistinctProjection.class));
assertTrue(distinctProjectionPrefixTokenGenerator.isGenerateSQLToken(selectStatementContext));
}
-
+
@Test
public void assertGenerateSQLToken() {
SelectStatementContext selectStatementContext = mock(SelectStatementContext.class, RETURNS_DEEP_STUBS);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyAssignmentTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyAssignmentTokenGeneratorTest.java
index 3cba10d7db0..23329f01246 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyAssignmentTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyAssignmentTokenGeneratorTest.java
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class GeneratedKeyAssignmentTokenGeneratorTest {
-
+
@Test
public void assertGenerateSQLToken() {
GeneratedKeyContext generatedKeyContext = mock(GeneratedKeyContext.class, RETURNS_DEEP_STUBS);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyForUseDefaultInsertColumnsTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyForUseDefaultInsertColumnsTokenGeneratorTest.java
index 32b1c39f677..d2bc461743d 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyForUseDefaultInsertColumnsTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyForUseDefaultInsertColumnsTokenGeneratorTest.java
@@ -33,7 +33,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class GeneratedKeyForUseDefaultInsertColumnsTokenGeneratorTest {
-
+
@Test
public void assertGenerateSQLToken() {
InsertColumnsSegment insertColumnsSegment = mock(InsertColumnsSegment.class);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyInsertColumnTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyInsertColumnTokenGeneratorTest.java
index 7c961cf1ea2..8755829db6a 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyInsertColumnTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyInsertColumnTokenGeneratorTest.java
@@ -32,7 +32,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class GeneratedKeyInsertColumnTokenGeneratorTest {
-
+
@Test
public void assertGenerateSQLToken() {
GeneratedKeyContext generatedKeyContext = mock(GeneratedKeyContext.class);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyInsertValuesTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyInsertValuesTokenGeneratorTest.java
index 53289ac6666..8a34b586ec8 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyInsertValuesTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/GeneratedKeyInsertValuesTokenGeneratorTest.java
@@ -40,7 +40,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class GeneratedKeyInsertValuesTokenGeneratorTest {
-
+
@Test
public void assertGenerateSQLToken() {
InsertStatementContext insertStatementContext = mock(InsertStatementContext.class);
@@ -64,7 +64,7 @@ public final class GeneratedKeyInsertValuesTokenGeneratorTest {
sqlToken = generatedKeyInsertValuesTokenGenerator.generateSQLToken(insertStatementContext);
assertThat(((InsertValuesToken) sqlToken).getInsertValues().get(0).getValues().get(0), instanceOf(DerivedLiteralExpressionSegment.class));
}
-
+
private List<SQLToken> getPreviousSQLTokens() {
List<ExpressionSegment> valuesList = new LinkedList<>();
InsertValue insertValue = mock(InsertValue.class);
@@ -77,7 +77,7 @@ public final class GeneratedKeyInsertValuesTokenGeneratorTest {
result.add(insertValuesToken);
return result;
}
-
+
private GeneratedKeyContext getGeneratedKeyContext() {
GeneratedKeyContext result = mock(GeneratedKeyContext.class);
Collection<Comparable<?>> generatedValuesCollection = new LinkedList<>();
@@ -85,7 +85,7 @@ public final class GeneratedKeyInsertValuesTokenGeneratorTest {
when(result.getGeneratedValues()).thenReturn(generatedValuesCollection);
return result;
}
-
+
private List<InsertValueContext> getInsertValueContextsList() {
InsertValueContext insertValueContext = mock(InsertValueContext.class);
List<InsertValueContext> result = new LinkedList<>();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java
index ef79cb96197..3c242a5fc19 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/IndexTokenGeneratorTest.java
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class IndexTokenGeneratorTest {
-
+
@Test
public void assertIsGenerateSQLToken() {
CreateDatabaseStatementContext createDatabaseStatementContext = mock(CreateDatabaseStatementContext.class);
@@ -51,7 +51,7 @@ public final class IndexTokenGeneratorTest {
indexSegmentCollection.add(mock(IndexSegment.class));
assertTrue(indexTokenGenerator.isGenerateSQLToken(alterIndexStatementContext));
}
-
+
@Test
public void assertGenerateSQLTokens() {
IndexSegment indexSegment = mock(IndexSegment.class);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OffsetTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OffsetTokenGeneratorTest.java
index 4582c763a8e..fb15588f83c 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OffsetTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OffsetTokenGeneratorTest.java
@@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class OffsetTokenGeneratorTest {
-
+
@Test
public void assertIsGenerateSQLToken() {
InsertStatementContext insertStatementContext = mock(InsertStatementContext.class);
@@ -54,7 +54,7 @@ public final class OffsetTokenGeneratorTest {
when(selectStatementContext.getPaginationContext().getOffsetSegment().get()).thenReturn(numberLiteralPaginationValueSegment);
assertTrue(offsetTokenGenerator.isGenerateSQLToken(selectStatementContext));
}
-
+
@Test
public void assertGenerateSQLToken() {
PaginationValueSegment paginationValueSegment = mock(PaginationValueSegment.class);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java
index 7e852fa222e..7260208e4a6 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/OrderByTokenGeneratorTest.java
@@ -45,13 +45,13 @@ import static org.mockito.Mockito.when;
public final class OrderByTokenGeneratorTest {
private static final String TEST_COLUMN_ORDER_BY_ITEM_SEGMENT_COLUMN_LABEL = "TEST_COLUMN_ORDER_BY_ITEM_SEGMENT_COLUMN_LABEL";
-
+
private static final String TEST_EXPRESSION_ORDER_BY_ITEM_SEGMENT_COLUMN_LABEL = "TEST_EXPRESSION_ORDER_BY_ITEM_SEGMENT_COLUMN_LABEL";
-
+
private static final int TEST_OTHER_CLASS_ORDER_BY_ITEM_INDEX = 5;
-
+
private OrderDirection orderDirection = mock(OrderDirection.class);
-
+
@Test
public void assertIsGenerateSQLToken() {
InsertStatementContext insertStatementContext = mock(InsertStatementContext.class);
@@ -63,7 +63,7 @@ public final class OrderByTokenGeneratorTest {
when(selectStatementContext.getOrderByContext().isGenerated()).thenReturn(Boolean.TRUE);
assertTrue(orderByTokenGenerator.isGenerateSQLToken(selectStatementContext));
}
-
+
@Test
public void assertGenerateSQLToken() {
WindowSegment windowSegment = mock(WindowSegment.class);
@@ -82,7 +82,7 @@ public final class OrderByTokenGeneratorTest {
assertThat(orderByToken.getColumnLabels().get(2), is(String.valueOf(TEST_OTHER_CLASS_ORDER_BY_ITEM_INDEX)));
assertThat(orderByToken.getOrderDirections().get(0), is(orderDirection));
}
-
+
private Collection<OrderByItem> getOrderByItemCollection() {
ColumnOrderByItemSegment columnOrderByItemSegment = mock(ColumnOrderByItemSegment.class);
when(columnOrderByItemSegment.getText()).thenReturn(TEST_COLUMN_ORDER_BY_ITEM_SEGMENT_COLUMN_LABEL);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java
index 35bcf0446d2..3038b34f724 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ProjectionsTokenGeneratorTest.java
@@ -52,23 +52,23 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ProjectionsTokenGeneratorTest {
-
+
private static final String TEST_AGGREGATION_DISTINCT_PROJECTION_DISTINCT_INNER_EXPRESSION = "TEST_AGGREGATION_DISTINCT_PROJECTION_DISTINCT_INNER_EXPRESSION";
-
+
private static final String TEST_AGGREGATION_DISTINCT_PROJECTION_ALIAS = "TEST_AGGREGATION_DISTINCT_PROJECTION_ALIAS";
-
+
private static final String TEST_DERIVED_PROJECTION_ALIAS = "TEST_DERIVED_PROJECTION_ALIAS";
-
+
private static final String TEST_LOGIC_TABLE_NAME = "TEST_LOGIC_TABLE_NAME";
-
+
private static final String TEST_ACTUAL_TABLE_NAME_WRAPPED = "TEST_ACTUAL_TABLE_NAME_WRAPPED";
-
+
private static final String TEST_OTHER_DERIVED_PROJECTION_ALIAS = "TEST_OTHER_DERIVED_PROJECTION_ALIAS";
-
+
private static final String TEST_OTHER_DERIVED_PROJECTION_EXPRESSION = "TEST_OTHER_DERIVED_PROJECTION_EXPRESSION";
-
+
private RouteUnit routeUnit;
-
+
@Before
public void setup() {
RouteMapper routeMapper = mock(RouteMapper.class);
@@ -79,7 +79,7 @@ public final class ProjectionsTokenGeneratorTest {
routeUnit = mock(RouteUnit.class);
when(routeUnit.getTableMappers()).thenReturn(routeMapperCollection);
}
-
+
@Test
public void assertIsGenerateSQLToken() {
ProjectionsTokenGenerator projectionsTokenGenerator = getProjectionsTokenGenerator();
@@ -94,7 +94,7 @@ public final class ProjectionsTokenGeneratorTest {
when(selectStatementContext.getProjectionsContext().getProjections()).thenReturn(projectionCollection);
assertTrue(projectionsTokenGenerator.isGenerateSQLToken(selectStatementContext));
}
-
+
@Test
public void assertGenerateSQLToken() {
Collection<Projection> projectionCollection = new LinkedList<>();
@@ -115,7 +115,7 @@ public final class ProjectionsTokenGeneratorTest {
+ ", " + TEST_ACTUAL_TABLE_NAME_WRAPPED + ".null" + " AS " + TEST_DERIVED_PROJECTION_ALIAS + " "
+ ", " + TEST_OTHER_DERIVED_PROJECTION_EXPRESSION + " AS " + TEST_OTHER_DERIVED_PROJECTION_ALIAS + " "));
}
-
+
private ProjectionsTokenGenerator getProjectionsTokenGenerator() {
Collection<RouteUnit> routeUnitCollection = new LinkedList<>();
routeUnitCollection.add(routeUnit);
@@ -125,7 +125,7 @@ public final class ProjectionsTokenGeneratorTest {
result.setRouteContext(routeContext);
return result;
}
-
+
private AggregationProjection getAggregationProjection() {
AggregationDistinctProjection derivedAggregationDistinctProjection = mock(AggregationDistinctProjection.class);
when(derivedAggregationDistinctProjection.getDistinctInnerExpression()).thenReturn(TEST_AGGREGATION_DISTINCT_PROJECTION_DISTINCT_INNER_EXPRESSION);
@@ -136,7 +136,7 @@ public final class ProjectionsTokenGeneratorTest {
when(aggregationProjection.getDerivedAggregationProjections()).thenReturn(derivedAggregationProjectionList);
return aggregationProjection;
}
-
+
private DerivedProjection getDerivedProjection() {
OwnerSegment ownerSegment = mock(OwnerSegment.class, RETURNS_DEEP_STUBS);
when(ownerSegment.getIdentifier().getValue()).thenReturn(TEST_LOGIC_TABLE_NAME);
@@ -152,7 +152,7 @@ public final class ProjectionsTokenGeneratorTest {
when(derivedProjection.getDerivedProjection()).thenReturn(oldColumnOrderByItemSegment);
return derivedProjection;
}
-
+
private DerivedProjection getOtherDerivedProjection() {
DerivedProjection result = mock(DerivedProjection.class);
when(result.getDerivedProjection()).thenReturn(null);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/RowCountTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/RowCountTokenGeneratorTest.java
index fe42c972028..904cd69de5f 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/RowCountTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/RowCountTokenGeneratorTest.java
@@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class RowCountTokenGeneratorTest {
-
+
@Test
public void assertIsGenerateSQLToken() {
InsertStatementContext insertStatementContext = mock(InsertStatementContext.class);
@@ -50,7 +50,7 @@ public final class RowCountTokenGeneratorTest {
when(selectStatementContext.getPaginationContext().getRowCountSegment()).thenReturn(Optional.of(numberLiteralPaginationValueSegment));
assertTrue(rowCountTokenGenerator.isGenerateSQLToken(selectStatementContext));
}
-
+
@Test
public void assertGenerateSQLToken() {
final int testOffsetSegmentValue = 12;
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingInsertValuesTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingInsertValuesTokenGeneratorTest.java
index 695358392a4..f6e7076c1a2 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingInsertValuesTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/ShardingInsertValuesTokenGeneratorTest.java
@@ -44,7 +44,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ShardingInsertValuesTokenGeneratorTest {
-
+
@Test
public void assertIsGenerateSQLToken() {
SelectStatementContext selectStatementContext = mock(SelectStatementContext.class);
@@ -56,7 +56,7 @@ public final class ShardingInsertValuesTokenGeneratorTest {
when(insertStatementContext.getSqlStatement().getValues().isEmpty()).thenReturn(Boolean.FALSE);
assertTrue(shardingInsertValuesTokenGenerator.isGenerateSQLToken(insertStatementContext));
}
-
+
@Test
public void assertGenerateSQLToken() {
List<ExpressionSegment> expressionSegmentList = new LinkedList<>();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/TableTokenGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/TableTokenGeneratorTest.java
index eb661105d71..619b25d67dc 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/TableTokenGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/TableTokenGeneratorTest.java
@@ -40,7 +40,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class TableTokenGeneratorTest {
-
+
@Test
public void assertGenerateSQLToken() {
ShardingRule shardingRule = mock(ShardingRule.class);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByTokenTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByTokenTest.java
index 377aa365864..698ab9fc57d 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByTokenTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/OrderByTokenTest.java
@@ -27,9 +27,9 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public final class OrderByTokenTest {
-
+
private OrderByToken orderByToken;
-
+
@Before
public void setup() {
orderByToken = new OrderByToken(0);
@@ -40,7 +40,7 @@ public final class OrderByTokenTest {
orderDirections.add(0, OrderDirection.ASC);
orderDirections.add(1, OrderDirection.ASC);
}
-
+
@Test
public void assertToString() {
assertThat(orderByToken.toString(), is(" ORDER BY Test1 ASC,Test2 ASC "));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingInsertValuesTokenTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingInsertValuesTokenTest.java
index 1898b0749ed..3f37f4c480b 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingInsertValuesTokenTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/ShardingInsertValuesTokenTest.java
@@ -35,11 +35,11 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public final class ShardingInsertValuesTokenTest {
-
+
private ShardingInsertValuesToken shardingInsertValuesToken;
-
+
private RouteUnit routeUnit;
-
+
@Before
public void setup() {
shardingInsertValuesToken = new ShardingInsertValuesToken(0, 2);
@@ -57,7 +57,7 @@ public final class ShardingInsertValuesTokenTest {
List<InsertValue> insertValues = shardingInsertValuesToken.getInsertValues();
insertValues.add(shardingInsertValue);
}
-
+
@Test
public void assertToString() {
assertThat(shardingInsertValuesToken.toString(routeUnit), is("('shardingsphere', 'test')"));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/ExpressionConditionUtilsTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/ExpressionConditionUtilsTest.java
index 4092213a2be..0df8ee6abc9 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/ExpressionConditionUtilsTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/ExpressionConditionUtilsTest.java
@@ -25,7 +25,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public final class ExpressionConditionUtilsTest {
-
+
@Test
public void assertIsNowExpression() {
assertFalse(ExpressionConditionUtils.isNowExpression(new LiteralExpressionSegment(0, 0, new Object())));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/ConditionValueGeneratorFactoryTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/ConditionValueGeneratorFactoryTest.java
index a22a9cd4443..563d90aa3ca 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/ConditionValueGeneratorFactoryTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/ConditionValueGeneratorFactoryTest.java
@@ -46,14 +46,14 @@ import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
public final class ConditionValueGeneratorFactoryTest {
-
+
private final Column column = new Column("id", "tbl");
-
+
@Before
public void setup() {
ShardingSphereServiceLoader.register(DatetimeService.class);
}
-
+
@Test
public void assertGenerateBinaryOperationExpression() {
ConditionValueCompareOperatorGenerator conditionValueCompareOperatorGenerator = new ConditionValueCompareOperatorGenerator();
@@ -64,7 +64,7 @@ public final class ConditionValueGeneratorFactoryTest {
assertThat(actual.get().getTableName(), is(expected.get().getTableName()));
assertThat(actual.get().getColumnName(), is(expected.get().getColumnName()));
}
-
+
@Test
public void assertGenerateInOperationExpression() {
ConditionValueInOperatorGenerator conditionValueInOperatorGenerator = new ConditionValueInOperatorGenerator();
@@ -77,7 +77,7 @@ public final class ConditionValueGeneratorFactoryTest {
assertThat(actual.get().getColumnName(), is(expected.get().getColumnName()));
assertThat(actual.get().getTableName(), is(expected.get().getTableName()));
}
-
+
@Test
public void assertGenerateBetweenExpression() {
ConditionValueBetweenOperatorGenerator conditionValueBetweenOperatorGenerator = new ConditionValueBetweenOperatorGenerator();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/ConditionValueTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/ConditionValueTest.java
index 9d24c32dde7..f46f508fa9b 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/ConditionValueTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/condition/generator/ConditionValueTest.java
@@ -29,19 +29,18 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public final class ConditionValueTest {
-
+
private ConditionValue conditionValue;
-
+
@Before
public void setUp() {
ExpressionSegment expressionSegment = new LiteralExpressionSegment(0, 0, "shardingsphere");
conditionValue = new ConditionValue(expressionSegment, new LinkedList<>());
}
-
+
@Test
public void assertGetValue() {
assertTrue(conditionValue.getValue().isPresent());
assertThat(conditionValue.getValue().get(), is("shardingsphere"));
}
}
-
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactoryTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactoryTest.java
index 26e27ab6048..9733ba71d0c 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactoryTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactoryTest.java
@@ -98,7 +98,7 @@ public final class ShardingRouteEngineFactoryTest {
private ShardingConditions shardingConditions;
private Collection<String> tableNames;
-
+
private final ConfigurationProperties props = new ConfigurationProperties(new Properties());
@Before
@@ -154,7 +154,7 @@ public final class ShardingRouteEngineFactoryTest {
public void assertNewInstanceForDALSetForMySQL() {
assertNewInstanceForDALSet(mock(MySQLSetStatement.class));
}
-
+
@Test
public void assertNewInstanceForDALSetForPostgreSQL() {
assertNewInstanceForDALSet(mock(PostgreSQLSetStatement.class));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/unicast/ShardingUnicastRoutingEngineTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/unicast/ShardingUnicastRoutingEngineTest.java
index 82b171db5a6..247b94f552d 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/unicast/ShardingUnicastRoutingEngineTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/unicast/ShardingUnicastRoutingEngineTest.java
@@ -53,14 +53,14 @@ public final class ShardingUnicastRoutingEngineTest {
assertThat(routeContext.getRouteUnits().size(), is(1));
assertFalse("ds_2".equalsIgnoreCase(routeContext.getRouteUnits().iterator().next().getDataSourceMapper().getLogicName()));
}
-
+
@Test
public void assertRoutingForBroadcastTable() {
ShardingUnicastRoutingEngine unicastRoutingEngine = new ShardingUnicastRoutingEngine(Collections.singleton("t_config"));
RouteContext routeContext = unicastRoutingEngine.route(shardingRule);
assertThat(routeContext.getRouteUnits().size(), is(1));
}
-
+
@Test
public void assertRoutingForNoTable() {
ShardingUnicastRoutingEngine unicastRoutingEngine = new ShardingUnicastRoutingEngine(Collections.emptyList());
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingRenameTableStatementValidatorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingRenameTableStatementValidatorTest.java
index 1a6af0b677c..c0bddf41bef 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingRenameTableStatementValidatorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/ShardingRenameTableStatementValidatorTest.java
@@ -49,10 +49,10 @@ import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public final class ShardingRenameTableStatementValidatorTest {
-
+
@Mock
private ShardingRule shardingRule;
-
+
@Test(expected = ShardingSphereException.class)
public void assertPreValidateShardingTable() {
SQLStatementContext<RenameTableStatement> sqlStatementContext = createRenameTableStatementContext("t_order", "t_user_order");
@@ -60,7 +60,7 @@ public final class ShardingRenameTableStatementValidatorTest {
when(shardingRule.tableRuleExists(argThat(tableNames -> tableNames.contains("t_order") || tableNames.contains("t_user_order")))).thenReturn(true);
new ShardingRenameTableStatementValidator().preValidate(shardingRule, sqlStatementContext, Collections.emptyList(), schema);
}
-
+
@Test(expected = ShardingSphereException.class)
public void assertPreValidateBroadcastTable() {
SQLStatementContext<RenameTableStatement> sqlStatementContext = createRenameTableStatementContext("t_order", "t_user_order");
@@ -68,14 +68,14 @@ public final class ShardingRenameTableStatementValidatorTest {
when(shardingRule.isBroadcastTable(eq("t_order"))).thenReturn(true);
new ShardingRenameTableStatementValidator().preValidate(shardingRule, sqlStatementContext, Collections.emptyList(), schema);
}
-
+
@Test
public void assertPreValidateNormalCase() {
SQLStatementContext<RenameTableStatement> sqlStatementContext = createRenameTableStatementContext("t_not_sharding_table", "t_not_sharding_table_new");
ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
new ShardingRenameTableStatementValidator().preValidate(shardingRule, sqlStatementContext, Collections.emptyList(), schema);
}
-
+
@Test(expected = ShardingSphereException.class)
public void assertPostValidateDifferentRouteUnitsAndDataNodesSize() {
RouteContext routeContext = new RouteContext();
@@ -89,7 +89,7 @@ public final class ShardingRenameTableStatementValidatorTest {
ConfigurationProperties props = mock(ConfigurationProperties.class);
new ShardingRenameTableStatementValidator().postValidate(shardingRule, sqlStatementContext, Collections.emptyList(), schema, props, routeContext);
}
-
+
@Test
public void assertPostValidateNormalCase() {
RouteContext routeContext = new RouteContext();
@@ -103,7 +103,7 @@ public final class ShardingRenameTableStatementValidatorTest {
ConfigurationProperties props = mock(ConfigurationProperties.class);
new ShardingRenameTableStatementValidator().postValidate(shardingRule, sqlStatementContext, Collections.emptyList(), schema, props, routeContext);
}
-
+
private SQLStatementContext<RenameTableStatement> createRenameTableStatementContext(final String originTableName, final String newTableName) {
MySQLRenameTableStatement sqlStatement = new MySQLRenameTableStatement();
RenameTableDefinitionSegment renameTableDefinitionSegment = new RenameTableDefinitionSegment(0, 0);
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/TableRuleTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/TableRuleTest.java
index 4833a043733..4c96b5ac724 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/TableRuleTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/TableRuleTest.java
@@ -158,7 +158,7 @@ public final class TableRuleTest {
shardingTableRuleConfig.setTableShardingStrategy(new StandardShardingStrategyConfiguration("shardingColumn", "INLINE"));
new TableRule(shardingTableRuleConfig, Arrays.asList("ds0", "ds1"), null);
}
-
+
@Test
public void assertDatNodeGroups() {
Collection<String> dataSourceNames = new LinkedList<>();
@@ -171,7 +171,7 @@ public final class TableRuleTest {
assertTrue(actual.get("ds0").contains(new DataNode("ds0", "table_0")));
assertTrue(actual.get("ds1").contains(new DataNode("ds1", "table_0")));
}
-
+
@Test
public void assertCreateTableRuleWithdataSourceNames() {
Collection<String> dataSourceNames = new LinkedList<>();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/scaling/distsql/handler/update/DisabledShardingScalingRuleStatementUpdaterTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/scaling/distsql/handler/update/DisabledShardingScalingRuleStatementUpdater [...]
index b54c3cfc148..462769e31fe 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/scaling/distsql/handler/update/DisabledShardingScalingRuleStatementUpdaterTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/scaling/distsql/handler/update/DisabledShardingScalingRuleStatementUpdaterTest.java
@@ -64,7 +64,7 @@ public final class DisabledShardingScalingRuleStatementUpdaterTest {
currentRuleConfig.getScaling().put(scalingName, null);
updater.checkSQLStatement(shardingSphereMetaData, createSQLStatement(scalingName), currentRuleConfig);
}
-
+
@Test
public void assertBuildToBeAlteredRuleConfiguration() {
ShardingRuleConfiguration result = updater.buildToBeAlteredRuleConfiguration(createSQLStatement("default_scaling"));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/scaling/distsql/handler/update/EnableShardingScalingRuleStatementUpdaterTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/scaling/distsql/handler/update/EnableShardingScalingRuleStatementUpdaterTest.java
index 54887b21371..471467cea41 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/scaling/distsql/handler/update/EnableShardingScalingRuleStatementUpdaterTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/scaling/distsql/handler/update/EnableShardingScalingRuleStatementUpdaterTest.java
@@ -67,7 +67,7 @@ public final class EnableShardingScalingRuleStatementUpdaterTest {
currentRuleConfig.setScalingName(scalingName);
updater.checkSQLStatement(shardingSphereMetaData, createSQLStatement(scalingName), currentRuleConfig);
}
-
+
@Test
public void assertBuildToBeAlteredRuleConfiguration() {
ShardingRuleConfiguration currentRuleConfig = new ShardingRuleConfiguration();
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAlgorithmQueryResultSetTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAlgorithmQueryResultSetTest.java
index 281613698aa..af1716c0de8 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAlgorithmQueryResultSetTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-handler/src/test/java/org/apache/shardingsphere/sharding/distsql/query/ShowShardingTableRulesUsedAlgorithmQueryResultSetTest.java
@@ -43,7 +43,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ShowShardingTableRulesUsedAlgorithmQueryResultSetTest {
-
+
@Test
public void assertGetRowData() {
ShardingSphereMetaData metaData = mock(ShardingSphereMetaData.class, RETURNS_DEEP_STUBS);
@@ -66,7 +66,7 @@ public final class ShowShardingTableRulesUsedAlgorithmQueryResultSetTest {
assertThat(actual.get(1), is("auto_table"));
assertThat(actual.get(2), is("t_order_auto"));
}
-
+
private ShardingRuleConfiguration createRuleConfiguration() {
ShardingRuleConfiguration result = new ShardingRuleConfiguration();
result.getTables().add(createShardingTableRuleConfiguration());
@@ -80,33 +80,33 @@ public final class ShowShardingTableRulesUsedAlgorithmQueryResultSetTest {
result.getKeyGenerators().put("snowflake", createKeyGeneratorConfiguration());
return result;
}
-
+
private ShardingAutoTableRuleConfiguration createShardingAutoTableRuleConfiguration() {
ShardingAutoTableRuleConfiguration result = new ShardingAutoTableRuleConfiguration("t_order_auto", "ds_0, ds_1");
result.setShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "auto_mod"));
result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("order_id", "snowflake"));
return result;
}
-
+
private ShardingTableRuleConfiguration createShardingTableRuleConfiguration() {
ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_order", "ds_${0..1}.t_order_${0..1}");
result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "t_order_inline"));
result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("order_id", "snowflake"));
return result;
}
-
+
private ShardingSphereAlgorithmConfiguration createShardingInlineAlgorithmConfiguration(final String algorithmExpression) {
Properties props = new Properties();
props.put("algorithm-expression", algorithmExpression);
return new ShardingSphereAlgorithmConfiguration("INLINE", props);
}
-
+
private ShardingSphereAlgorithmConfiguration createShardingAutoModAlgorithmConfiguration() {
Properties props = new Properties();
props.put("sharding-count", 4);
return new ShardingSphereAlgorithmConfiguration("MOD", props);
}
-
+
private ShardingSphereAlgorithmConfiguration createKeyGeneratorConfiguration() {
return new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", new Properties());
}
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/insert/values/InsertValueContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/insert/values/InsertValueContextTest.java
index 80d4bef14c9..35f85584e77 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/insert/values/InsertValueContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/insert/values/InsertValueContextTest.java
@@ -83,7 +83,7 @@ public final class InsertValueContextTest {
private Collection<ExpressionSegment> makeLiteralExpressionSegment(final Object literalObject) {
return Collections.singleton(new LiteralExpressionSegment(0, 10, literalObject));
}
-
+
@Test
public void assertGetParameterCount() {
Collection<ExpressionSegment> expressions = Arrays.asList(
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/groupby/engine/GroupByContextEngineTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/groupby/engine/GroupByContextEngineTest.java
index 7c93bad8108..fa740952945 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/groupby/engine/GroupByContextEngineTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/groupby/engine/GroupByContextEngineTest.java
@@ -46,27 +46,27 @@ public final class GroupByContextEngineTest {
public void assertCreateGroupByContextWithoutGroupByForMySQL() {
assertCreateGroupByContextWithoutGroupBy(new MySQLSelectStatement());
}
-
+
@Test
public void assertCreateGroupByContextWithoutGroupByForOracle() {
assertCreateGroupByContextWithoutGroupBy(new OracleSelectStatement());
}
-
+
@Test
public void assertCreateGroupByContextWithoutGroupByForPostgreSQL() {
assertCreateGroupByContextWithoutGroupBy(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCreateGroupByContextWithoutGroupByForSQL92() {
assertCreateGroupByContextWithoutGroupBy(new SQL92SelectStatement());
}
-
+
@Test
public void assertCreateGroupByContextWithoutGroupByForSQLServer() {
assertCreateGroupByContextWithoutGroupBy(new SQLServerSelectStatement());
}
-
+
private void assertCreateGroupByContextWithoutGroupBy(final SelectStatement selectStatement) {
GroupByContext actualGroupByContext = new GroupByContextEngine().createGroupByContext(selectStatement);
assertTrue(actualGroupByContext.getItems().isEmpty());
@@ -76,27 +76,27 @@ public final class GroupByContextEngineTest {
public void assertCreateGroupByContextWithGroupByForMySQL() {
assertCreateGroupByContextWithGroupBy(new MySQLSelectStatement());
}
-
+
@Test
public void assertCreateGroupByContextWithGroupByForOracle() {
assertCreateGroupByContextWithGroupBy(new OracleSelectStatement());
}
-
+
@Test
public void assertCreateGroupByContextWithGroupByForPostgreSQL() {
assertCreateGroupByContextWithGroupBy(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCreateGroupByContextWithGroupByForSQL92() {
assertCreateGroupByContextWithGroupBy(new SQL92SelectStatement());
}
-
+
@Test
public void assertCreateGroupByContextWithGroupByForSQLServer() {
assertCreateGroupByContextWithGroupBy(new SQLServerSelectStatement());
}
-
+
private void assertCreateGroupByContextWithGroupBy(final SelectStatement selectStatement) {
OrderByItemSegment columnOrderByItemSegment = new ColumnOrderByItemSegment(new ColumnSegment(0, 1, new IdentifierValue("column1")), OrderDirection.ASC);
OrderByItemSegment indexOrderByItemSegment1 = new IndexOrderByItemSegment(1, 2, 2, OrderDirection.ASC, OrderDirection.DESC);
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/engine/PaginationContextEngineTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/engine/PaginationContextEngineTest.java
index f401c24da67..81f1e0947f4 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/engine/PaginationContextEngineTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/pagination/engine/PaginationContextEngineTest.java
@@ -54,7 +54,7 @@ public final class PaginationContextEngineTest {
assertTrue(paginationContext.getOffsetSegment().isPresent());
assertTrue(paginationContext.getRowCountSegment().isPresent());
}
-
+
@Test
public void assertCreatePaginationContextWhenLimitSegmentIsPresentForPostgreSQL() {
PostgreSQLSelectStatement selectStatement = new PostgreSQLSelectStatement();
@@ -65,7 +65,7 @@ public final class PaginationContextEngineTest {
assertTrue(paginationContext.getOffsetSegment().isPresent());
assertTrue(paginationContext.getRowCountSegment().isPresent());
}
-
+
@Test
public void assertCreatePaginationContextWhenLimitSegmentIsPresentForSQL92() {
SQL92SelectStatement selectStatement = new SQL92SelectStatement();
@@ -76,7 +76,7 @@ public final class PaginationContextEngineTest {
assertTrue(paginationContext.getOffsetSegment().isPresent());
assertTrue(paginationContext.getRowCountSegment().isPresent());
}
-
+
@Test
public void assertCreatePaginationContextWhenLimitSegmentIsPresentForSQLServer() {
SQLServerSelectStatement selectStatement = new SQLServerSelectStatement();
@@ -114,27 +114,27 @@ public final class PaginationContextEngineTest {
assertFalse(paginationContext.getOffsetSegment().isPresent());
assertFalse(paginationContext.getRowCountSegment().isPresent());
}
-
+
@Test
public void assertCreatePaginationContextWhenResultIsPaginationContextForMySQL() {
assertCreatePaginationContextWhenResultIsPaginationContext(new MySQLSelectStatement());
}
-
+
@Test
public void assertCreatePaginationContextWhenResultIsPaginationContextForOracle() {
assertCreatePaginationContextWhenResultIsPaginationContext(new OracleSelectStatement());
}
-
+
@Test
public void assertCreatePaginationContextWhenResultIsPaginationContextForPostgreSQL() {
assertCreatePaginationContextWhenResultIsPaginationContext(new PostgreSQLSelectStatement());
}
-
+
@Test
public void assertCreatePaginationContextWhenResultIsPaginationContextForSQL92() {
assertCreatePaginationContextWhenResultIsPaginationContext(new SQL92SelectStatement());
}
-
+
@Test
public void assertCreatePaginationContextWhenResultIsPaginationContextForSQLServer() {
assertCreatePaginationContextWhenResultIsPaginationContext(new SQLServerSelectStatement());
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java
index 137f4788800..ca2c85f886b 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionEngineTest.java
@@ -143,7 +143,7 @@ public final class ProjectionEngineTest {
assertTrue(actual.isPresent());
assertThat(actual.get(), instanceOf(AggregationProjection.class));
}
-
+
@Test
public void assertCreateProjectionWhenProjectionSegmentInstanceOfParameterMarkerExpressionSegment() {
ParameterMarkerExpressionSegment parameterMarkerExpressionSegment = new ParameterMarkerExpressionSegment(7, 7, 0);
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionsContextEngineTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionsContextEngineTest.java
index d5306ba2931..ee42eb30e96 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionsContextEngineTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/engine/ProjectionsContextEngineTest.java
@@ -355,7 +355,7 @@ public final class ProjectionsContextEngineTest {
.createProjectionsContext(selectStatement.getFrom(), projectionsSegment, new GroupByContext(Collections.emptyList()), orderByContext);
assertNotNull(actual);
}
-
+
@Test
public void assertCreateProjectionsContextWithTemporaryTableForMySQL() {
assertCreateProjectionsContextWithTemporaryTable(new MySQLSelectStatement(), new MySQLSelectStatement());
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjectionTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjectionTest.java
index e6141d8525d..b59e242ea86 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjectionTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/segment/select/projection/impl/AggregationProjectionTest.java
@@ -30,32 +30,32 @@ import static org.mockito.Mockito.mock;
public final class AggregationProjectionTest {
private final AggregationType aggregationType = AggregationType.COUNT;
-
+
private final String innerExpression = "( A.\"DIRECTION\" )";
-
+
private final String alias = "AVG_DERIVED_COUNT_0";
-
+
private final AggregationProjection aggregationProjection1 = new AggregationProjection(aggregationType, innerExpression, alias, mock(DatabaseType.class));
-
+
private final AggregationProjection aggregationProjection2 = new AggregationProjection(aggregationType, innerExpression, null, mock(DatabaseType.class));
-
+
@Test
public void assertGetExpression() {
assertThat(aggregationProjection1.getExpression(), is(aggregationType + innerExpression));
}
-
+
@Test
public void assertGetAlias() {
Optional<String> actual = aggregationProjection1.getAlias();
assertTrue(actual.isPresent());
assertThat(actual.get(), is(alias));
}
-
+
@Test
public void assertGetColumnLabel() {
assertThat(aggregationProjection1.getColumnLabel(), is(alias));
}
-
+
@Test
public void assertGetColumnLabelWithoutAlias() {
assertThat(aggregationProjection2.getColumnLabel(), is(aggregationType + innerExpression));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/AnalyzeTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/AnalyzeTableStatementContextTest.java
index 7e7a8aa511a..d9d4dd27238 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/AnalyzeTableStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/AnalyzeTableStatementContextTest.java
@@ -38,17 +38,17 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class AnalyzeTableStatementContextTest {
-
+
@Test
public void assertMysqlNewInstance() {
assertNewInstance(mock(MySQLAnalyzeTableStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLAnalyzeTableStatement.class));
}
-
+
private void assertNewInstance(final AnalyzeTableStatement analyzeTableStatement) {
SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ExplainStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ExplainStatementContextTest.java
index 025f69440e1..f96e79d3233 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ExplainStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ExplainStatementContextTest.java
@@ -34,17 +34,17 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ExplainStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLExplainStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLExplainStatement.class));
}
-
+
private void assertNewInstance(final ExplainStatement explainStatement) {
SQLStatement statement = () -> 0;
when(explainStatement.getStatement()).thenReturn(Optional.of(statement));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowColumnsStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowColumnsStatementContextTest.java
index 8140f250453..af7784a9680 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowColumnsStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowColumnsStatementContextTest.java
@@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ShowColumnsStatementContextTest {
-
+
@Test
public void assertNewInstance() {
MySQLShowColumnsStatement mySQLShowColumnsStatement = mock(MySQLShowColumnsStatement.class);
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowCreateTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowCreateTableStatementContextTest.java
index 3e766f64d75..a5fb994131b 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowCreateTableStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowCreateTableStatementContextTest.java
@@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ShowCreateTableStatementContextTest {
-
+
@Test
public void assertNewInstance() {
MySQLShowCreateTableStatement mySQLShowCreateTableStatement = mock(MySQLShowCreateTableStatement.class);
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowIndexStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowIndexStatementContextTest.java
index 853fedd1b30..de94ac24b37 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowIndexStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dal/ShowIndexStatementContextTest.java
@@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ShowIndexStatementContextTest {
-
+
@Test
public void assertNewInstance() {
MySQLShowIndexStatement mySQLShowIndexStatement = mock(MySQLShowIndexStatement.class);
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/DenyUserStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/DenyUserStatementContextTest.java
index 6cda5b1f169..44b7fa09a32 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/DenyUserStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/DenyUserStatementContextTest.java
@@ -34,7 +34,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class DenyUserStatementContextTest {
-
+
@Test
public void assertNewInstance() {
SQLServerDenyUserStatement sqlServerDenyUserStatement = mock(SQLServerDenyUserStatement.class);
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/GrantStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/GrantStatementContextTest.java
index fafb3cc1a62..af32052246a 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/GrantStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/GrantStatementContextTest.java
@@ -41,32 +41,32 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class GrantStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLGrantStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLGrantStatement.class));
}
-
+
@Test
public void assertOracleNewInstance() {
assertNewInstance(mock(OracleGrantStatement.class));
}
-
+
@Test
public void assertSQLServerNewInstance() {
assertNewInstance(mock(SQLServerGrantStatement.class));
}
-
+
@Test
public void assertSQL92NewInstance() {
assertNewInstance(mock(SQL92GrantStatement.class));
}
-
+
private void assertNewInstance(final GrantStatement grantStatement) {
SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/RevokeStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/RevokeStatementContextTest.java
index 0c8d95015d1..a6e464f3cff 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/RevokeStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/dcl/RevokeStatementContextTest.java
@@ -41,32 +41,32 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class RevokeStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLRevokeStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLRevokeStatement.class));
}
-
+
@Test
public void assertOracleNewInstance() {
assertNewInstance(mock(OracleRevokeStatement.class));
}
-
+
@Test
public void assertSQLServerNewInstance() {
assertNewInstance(mock(SQLServerRevokeStatement.class));
}
-
+
@Test
public void assertSQL92NewInstance() {
assertNewInstance(mock(SQL92RevokeStatement.class));
}
-
+
private void assertNewInstance(final RevokeStatement revokeStatement) {
SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterIndexStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterIndexStatementContextTest.java
index 00b745ee634..45240eeb7ff 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterIndexStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterIndexStatementContextTest.java
@@ -37,22 +37,22 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class AlterIndexStatementContextTest {
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLAlterIndexStatement.class));
}
-
+
@Test
public void assertOracleNewInstance() {
assertNewInstance(mock(OracleAlterIndexStatement.class));
}
-
+
@Test
public void assertSQLServerNewInstance() {
assertNewInstance(mock(SQLServerAlterIndexStatement.class));
}
-
+
private void assertNewInstance(final AlterIndexStatement alterIndexStatement) {
IndexSegment indexSegment = new IndexSegment(0, 0, new IdentifierValue("index_1"));
when(alterIndexStatement.getIndex()).thenReturn(Optional.of(indexSegment));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterTableStatementContextTest.java
index c5d4dde9093..1e9eaa60de5 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterTableStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterTableStatementContextTest.java
@@ -53,32 +53,32 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class AlterTableStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLAlterTableStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLAlterTableStatement.class));
}
-
+
@Test
public void assertOracleNewInstance() {
assertNewInstance(mock(OracleAlterTableStatement.class));
}
-
+
@Test
public void assertSQLServerNewInstance() {
assertNewInstance(mock(SQLServerAlterTableStatement.class));
}
-
+
@Test
public void assertSQL92NewInstance() {
assertNewInstance(mock(SQL92AlterTableStatement.class));
}
-
+
private void assertNewInstance(final AlterTableStatement alterTableStatement) {
SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
SimpleTableSegment renameTable = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("rename_tbl_1")));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterViewStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterViewStatementContextTest.java
index d6e427b561a..847efb2432f 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterViewStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/AlterViewStatementContextTest.java
@@ -38,14 +38,14 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class AlterViewStatementContextTest {
-
+
private SimpleTableSegment view;
-
+
@Before
public void setUp() {
view = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("view")));
}
-
+
@Test
public void assertMySQLNewInstance() {
SelectStatement select = mock(MySQLSelectStatement.class);
@@ -55,14 +55,14 @@ public final class AlterViewStatementContextTest {
when(mySQLAlterViewStatement.getSelect()).thenReturn(Optional.of(select));
assertNewInstance(mySQLAlterViewStatement);
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
PostgreSQLAlterViewStatement postgreSQLAlterViewStatement = mock(PostgreSQLAlterViewStatement.class);
when(postgreSQLAlterViewStatement.getView()).thenReturn(view);
assertNewInstance(postgreSQLAlterViewStatement);
}
-
+
private void assertNewInstance(final AlterViewStatement alterViewStatement) {
AlterViewStatementContext actual = new AlterViewStatementContext(alterViewStatement);
assertThat(actual, instanceOf(CommonSQLStatementContext.class));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateDatabaseStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateDatabaseStatementContextTest.java
index 15fe091f51a..a3e853e3aec 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateDatabaseStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateDatabaseStatementContextTest.java
@@ -31,17 +31,17 @@ import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
public final class CreateDatabaseStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLCreateDatabaseStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLCreateDatabaseStatement.class));
}
-
+
private void assertNewInstance(final CreateDatabaseStatement createDatabaseStatement) {
CreateDatabaseStatementContext actual = new CreateDatabaseStatementContext(createDatabaseStatement);
assertThat(actual, instanceOf(CommonSQLStatementContext.class));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateFunctionStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateFunctionStatementContextTest.java
index f68098a19d2..71ce6ce150f 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateFunctionStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateFunctionStatementContextTest.java
@@ -30,22 +30,22 @@ import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
public final class CreateFunctionStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLCreateFunctionStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLCreateFunctionStatement.class));
}
-
+
@Test
public void assertSQLServerNewInstance() {
assertNewInstance(mock(SQLServerCreateFunctionStatement.class));
}
-
+
private void assertNewInstance(final CreateFunctionStatement createDatabaseStatement) {
CreateFunctionStatementContext actual = new CreateFunctionStatementContext(createDatabaseStatement);
assertThat(actual, instanceOf(CommonSQLStatementContext.class));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateIndexStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateIndexStatementContextTest.java
index 0fe3c5f30b9..de511e38ede 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateIndexStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateIndexStatementContextTest.java
@@ -38,27 +38,27 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class CreateIndexStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLCreateIndexStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLCreateIndexStatement.class));
}
-
+
@Test
public void assertOracleSQLNewInstance() {
assertNewInstance(mock(OracleCreateIndexStatement.class));
}
-
+
@Test
public void assertSQLServerSQLNewInstance() {
assertNewInstance(mock(SQLServerCreateIndexStatement.class));
}
-
+
private void assertNewInstance(final CreateIndexStatement createIndexStatement) {
CreateIndexStatementContext actual = new CreateIndexStatementContext(createIndexStatement);
assertThat(actual, instanceOf(CommonSQLStatementContext.class));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateProcedureStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateProcedureStatementContextTest.java
index 3bfc400477d..5a0fd1aef92 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateProcedureStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateProcedureStatementContextTest.java
@@ -29,17 +29,17 @@ import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
public final class CreateProcedureStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLCreateProcedureStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLCreateProcedureStatement.class));
}
-
+
private void assertNewInstance(final CreateProcedureStatement createProcedureStatement) {
CreateProcedureStatementContext actual = new CreateProcedureStatementContext(createProcedureStatement);
assertThat(actual, instanceOf(CommonSQLStatementContext.class));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateTableStatementContextTest.java
index af8d9f44fe1..9b84765aaa9 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateTableStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateTableStatementContextTest.java
@@ -46,32 +46,32 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class CreateTableStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLCreateTableStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLCreateTableStatement.class));
}
-
+
@Test
public void assertOracleNewInstance() {
assertNewInstance(mock(OracleCreateTableStatement.class));
}
-
+
@Test
public void assertSQLServerNewInstance() {
assertNewInstance(mock(SQLServerCreateTableStatement.class));
}
-
+
@Test
public void assertSQL92NewInstance() {
assertNewInstance(mock(SQL92CreateTableStatement.class));
}
-
+
private void assertNewInstance(final CreateTableStatement createTableStatement) {
CreateTableStatementContext actual = new CreateTableStatementContext(createTableStatement);
SimpleTableSegment table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateViewStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateViewStatementContextTest.java
index adaef062a5e..ca21ff6f7f3 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateViewStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/CreateViewStatementContextTest.java
@@ -33,17 +33,17 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class CreateViewStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLCreateViewStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLCreateViewStatement.class));
}
-
+
private void assertNewInstance(final CreateViewStatement createViewStatement) {
SimpleTableSegment view = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("view")));
when(createViewStatement.getView()).thenReturn(view);
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropIndexStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropIndexStatementContextTest.java
index ab584f31e13..8a948fa0a4c 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropIndexStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropIndexStatementContextTest.java
@@ -40,27 +40,27 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class DropIndexStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLDropIndexStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLDropIndexStatement.class));
}
-
+
@Test
public void assertOracleNewInstance() {
assertNewInstance(mock(OracleDropIndexStatement.class));
}
-
+
@Test
public void assertSQLServerNewInstance() {
assertNewInstance(mock(SQLServerDropIndexStatement.class));
}
-
+
private void assertNewInstance(final DropIndexStatement dropIndexStatement) {
Collection<IndexSegment> indexes = new LinkedList<>();
IndexSegment index1 = new IndexSegment(0, 0, new IdentifierValue("idx_1"));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropTableStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropTableStatementContextTest.java
index b55b58e8b65..42c9d2cf08c 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropTableStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropTableStatementContextTest.java
@@ -39,32 +39,32 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class DropTableStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLDropTableStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLDropTableStatement.class));
}
-
+
@Test
public void assertOracleNewInstance() {
assertNewInstance(mock(OracleDropTableStatement.class));
}
-
+
@Test
public void assertSQLServerNewInstance() {
assertNewInstance(mock(SQLServerDropTableStatement.class));
}
-
+
@Test
public void assertSQL92NewInstance() {
assertNewInstance(mock(SQL92DropTableStatement.class));
}
-
+
private void assertNewInstance(final DropTableStatement dropTableStatement) {
DropTableStatementContext actual = new DropTableStatementContext(dropTableStatement);
SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropViewStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropViewStatementContextTest.java
index c81fa2a9fef..5db60d7a0a9 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropViewStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/DropViewStatementContextTest.java
@@ -35,17 +35,17 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class DropViewStatementContextTest {
-
+
@Test
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLDropViewStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLDropViewStatement.class));
}
-
+
private void assertNewInstance(final DropViewStatement dropViewStatement) {
SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/PrepareStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/PrepareStatementContextTest.java
index a88472bd40c..a6e022c111d 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/PrepareStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/PrepareStatementContextTest.java
@@ -48,17 +48,17 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class PrepareStatementContextTest {
-
+
private ColumnSegment column;
-
+
private SimpleTableSegment table;
-
+
@Before
public void setUp() {
table = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
column = new ColumnSegment(0, 0, new IdentifierValue("col_1"));
}
-
+
@Test
public void assertNewInstance() {
PostgreSQLPrepareStatement postgreSQLPrepare = mock(PostgreSQLPrepareStatement.class);
@@ -72,19 +72,19 @@ public final class PrepareStatementContextTest {
assertThat(actual.getAllTables().stream().map(each -> each.getTableName().getIdentifier().getValue()).collect(Collectors.toList()),
is(Arrays.asList("tbl_1", "tbl_1", "tbl_1", "tbl_1")));
}
-
+
private SelectStatement getSelect() {
SelectStatement select = new PostgreSQLSelectStatement();
select.setFrom(table);
return select;
}
-
+
private InsertStatement getInsert() {
InsertStatement insert = new PostgreSQLInsertStatement();
insert.setTable(table);
return insert;
}
-
+
private UpdateStatement getUpdate() {
UpdateStatement update = new PostgreSQLUpdateStatement();
update.setTableSegment(table);
@@ -92,7 +92,7 @@ public final class PrepareStatementContextTest {
update.setSetAssignment(setAssignmentSegment);
return update;
}
-
+
private DeleteStatement getDelete() {
DeleteStatement delete = new PostgreSQLDeleteStatement();
delete.setTableSegment(table);
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/TruncateStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/TruncateStatementContextTest.java
index 6cb6705be7d..8c0cc02d503 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/TruncateStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/ddl/TruncateStatementContextTest.java
@@ -43,22 +43,22 @@ public final class TruncateStatementContextTest {
public void assertMySQLNewInstance() {
assertNewInstance(mock(MySQLTruncateStatement.class));
}
-
+
@Test
public void assertPostgreSQLNewInstance() {
assertNewInstance(mock(PostgreSQLTruncateStatement.class));
}
-
+
@Test
public void assertOracleNewInstance() {
assertNewInstance(mock(OracleTruncateStatement.class));
}
-
+
@Test
public void assertSQLServerNewInstance() {
assertNewInstance(mock(SQLServerTruncateStatement.class));
}
-
+
private void assertNewInstance(final TruncateStatement truncateStatement) {
SimpleTableSegment table1 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_1")));
SimpleTableSegment table2 = new SimpleTableSegment(new TableNameSegment(0, 0, new IdentifierValue("tbl_2")));
diff --git a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/impl/SelectStatementContextTest.java b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/impl/SelectStatementContextTest.java
index 921cd65d67a..f577ab7cf3c 100644
--- a/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/impl/SelectStatementContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-binder/src/test/java/org/apache/shardingsphere/infra/binder/statement/impl/SelectStatementContextTest.java
@@ -484,7 +484,7 @@ public final class SelectStatementContextTest {
SelectStatementContext actual = new SelectStatementContext(Collections.singletonMap(DefaultSchema.LOGIC_NAME, metaData), Collections.emptyList(), selectStatement, DefaultSchema.LOGIC_NAME);
assertTrue(actual.isContainsSubquery());
}
-
+
private OrderByItemSegment createOrderByItemSegment(final String type) {
switch (type) {
case INDEX_ORDER_BY:
@@ -499,7 +499,7 @@ public final class SelectStatementContextTest {
return new ColumnOrderByItemSegment(new ColumnSegment(0, 0, new IdentifierValue("id")), OrderDirection.ASC, OrderDirection.ASC);
}
}
-
+
private ProjectionsSegment createProjectionsSegment() {
ProjectionsSegment projectionsSegment = new ProjectionsSegment(0, 0);
projectionsSegment.setDistinctRow(true);
@@ -507,13 +507,13 @@ public final class SelectStatementContextTest {
getColumnProjectionSegmentWithoutOwner(true), getColumnProjectionSegmentWithoutOwner(false)));
return projectionsSegment;
}
-
+
private ProjectionSegment getColumnProjectionSegmentWithoutOwner() {
ColumnSegment columnSegment = new ColumnSegment(0, 0, new IdentifierValue("name"));
columnSegment.setOwner(new OwnerSegment(0, 0, new IdentifierValue("table")));
return new ColumnProjectionSegment(columnSegment);
}
-
+
private ProjectionSegment getColumnProjectionSegmentWithoutOwner(final boolean hasAlias) {
ColumnSegment columnSegment = new ColumnSegment(0, 0, new IdentifierValue(hasAlias ? "name" : "id"));
ColumnProjectionSegment columnProjectionSegment = new ColumnProjectionSegment(columnSegment);
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/RuleConfigurationCheckerFixture.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/RuleConfigurationCheckerFixture.java
index 9ed007bb689..8153eec51cf 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/RuleConfigurationCheckerFixture.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/config/checker/RuleConfigurationCheckerFixture.java
@@ -20,17 +20,17 @@ package org.apache.shardingsphere.infra.config.checker;
import org.apache.shardingsphere.infra.fixture.TestRuleConfiguration;
public final class RuleConfigurationCheckerFixture implements RuleConfigurationChecker<TestRuleConfiguration> {
-
+
@Override
public void check(final String schemaName, final TestRuleConfiguration config) {
-
+
}
-
+
@Override
public int getOrder() {
return -10;
}
-
+
@Override
public Class<TestRuleConfiguration> getTypeClass() {
return TestRuleConfiguration.class;
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/DataSourceMetaDataTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/DataSourceMetaDataTest.java
index 3022e520bb5..e701d4d0efd 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/DataSourceMetaDataTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/DataSourceMetaDataTest.java
@@ -36,42 +36,42 @@ public final class DataSourceMetaDataTest {
H2DataSourceMetaData actual2 = new H2DataSourceMetaData("jdbc:h2:tcp://localhost:8082/~/test1/test2;DB_CLOSE_DELAY=-1");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithMysql() {
MySQLDataSourceMetaData actual1 = new MySQLDataSourceMetaData("jdbc:mysql://127.0.0.1:9999/ds_1?serverTimezone=UTC&useSSL=false");
MySQLDataSourceMetaData actual2 = new MySQLDataSourceMetaData("jdbc:mysql://127.0.0.1:9999/ds_0?serverTimezone=UTC&useSSL=false");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithOracle() {
OracleDataSourceMetaData actual1 = new OracleDataSourceMetaData("jdbc:oracle:thin:@//127.0.0.1:9999/ds_0", "test");
OracleDataSourceMetaData actual2 = new OracleDataSourceMetaData("jdbc:oracle:thin:@//127.0.0.1:9999/ds_1", "test");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithMariaDB() {
MariaDBDataSourceMetaData actual1 = new MariaDBDataSourceMetaData("jdbc:mariadb://127.0.0.1:9999/ds_0?serverTimezone=UTC&useSSL=false");
MariaDBDataSourceMetaData actual2 = new MariaDBDataSourceMetaData("jdbc:mariadb://127.0.0.1:9999/ds_1?serverTimezone=UTC&useSSL=false");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithPostgreSQL() {
PostgreSQLDataSourceMetaData actual1 = new PostgreSQLDataSourceMetaData("jdbc:postgresql://127.0.0.1/ds_0");
PostgreSQLDataSourceMetaData actual2 = new PostgreSQLDataSourceMetaData("jdbc:postgresql://127.0.0.1/ds_1");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithSQL92() {
SQL92DataSourceMetaData actual1 = new SQL92DataSourceMetaData("jdbc:sql92_db:ds_0");
SQL92DataSourceMetaData actual2 = new SQL92DataSourceMetaData("jdbc:sql92_db:ds_1");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithSQLServer() {
SQLServerDataSourceMetaData actual1 = new SQLServerDataSourceMetaData("jdbc:microsoft:sqlserver://127.0.0.1:9999;DatabaseName=ds_0");
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/H2DataSourceMetaDataTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/H2DataSourceMetaDataTest.java
index e9853688921..432d62d4e6d 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/H2DataSourceMetaDataTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/H2DataSourceMetaDataTest.java
@@ -70,56 +70,56 @@ public final class H2DataSourceMetaDataTest {
assertThat(actual.getCatalog(), is("sample"));
assertNull(actual.getSchema());
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithMem() {
H2DataSourceMetaData actual1 = new H2DataSourceMetaData("jdbc:h2:mem:ds_0;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL");
H2DataSourceMetaData actual2 = new H2DataSourceMetaData("jdbc:h2:mem:ds_1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithSymbol() {
H2DataSourceMetaData actual1 = new H2DataSourceMetaData("jdbc:h2:~:ds-0;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL");
H2DataSourceMetaData actual2 = new H2DataSourceMetaData("jdbc:h2:~:ds-1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstance() {
H2DataSourceMetaData actual1 = new H2DataSourceMetaData("jdbc:h2:mem:ds_0;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL");
H2DataSourceMetaData actual2 = new H2DataSourceMetaData("jdbc:h2:~:ds-1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithTcp() {
H2DataSourceMetaData actual1 = new H2DataSourceMetaData("jdbc:h2:tcp://localhost:8082/~/test1/test2;DB_CLOSE_DELAY=-1");
H2DataSourceMetaData actual2 = new H2DataSourceMetaData("jdbc:h2:tcp://localhost:8082/~/test3/test4;DB_CLOSE_DELAY=-1");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertFalseIsInSameDatabaseInstanceWithTcp() {
H2DataSourceMetaData actual1 = new H2DataSourceMetaData("jdbc:h2:tcp://localhost:8082/~/test1/test2;DB_CLOSE_DELAY=-1");
H2DataSourceMetaData actual2 = new H2DataSourceMetaData("jdbc:h2:tcp://192.168.64.76:8082/~/test3/test4;DB_CLOSE_DELAY=-1");
assertFalse(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithSsl() {
H2DataSourceMetaData actual1 = new H2DataSourceMetaData("jdbc:h2:ssl:180.76.76.76/home/test-one");
H2DataSourceMetaData actual2 = new H2DataSourceMetaData("jdbc:h2:ssl:180.76.76.76/home/test-two");
assertTrue(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertFalseIsInSameDatabaseInstanceWithSsl() {
H2DataSourceMetaData actual1 = new H2DataSourceMetaData("jdbc:h2:ssl:180.76.76.76/home/test-one");
H2DataSourceMetaData actual2 = new H2DataSourceMetaData("jdbc:h2:ssl:181.76.76.76/home/test-two");
assertFalse(actual1.isInSameDatabaseInstance(actual2));
}
-
+
@Test
public void assertIsInSameDatabaseInstanceWithFile() {
H2DataSourceMetaData actual1 = new H2DataSourceMetaData("jdbc:h2:file:/data/sample-one;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false");
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/SQLServerDataSourceMetaDataTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/SQLServerDataSourceMetaDataTest.java
index fe26fe68dda..adba2f7bffb 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/SQLServerDataSourceMetaDataTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/metadata/dialect/SQLServerDataSourceMetaDataTest.java
@@ -58,7 +58,7 @@ public final class SQLServerDataSourceMetaDataTest {
assertThat(actual.getPort(), is(1433));
assertNull(actual.getSchema());
}
-
+
@Test
public void assertNewConstructorWithDataBaseNameContainDotAndMicrosoft() {
SQLServerDataSourceMetaData actual = new SQLServerDataSourceMetaData("jdbc:microsoft:sqlserver://127.0.0.1:9999;DatabaseName=ds_0.0.0");
@@ -67,7 +67,7 @@ public final class SQLServerDataSourceMetaDataTest {
assertThat(actual.getCatalog(), is("ds_0.0.0"));
assertNull(actual.getSchema());
}
-
+
@Test
public void assertNewConstructorWithDataBaseNameContainDotAndWithoutMicrosoft() {
SQLServerDataSourceMetaData actual = new SQLServerDataSourceMetaData("jdbc:sqlserver://127.0.0.1:9999;DatabaseName=ds_0.0.0");
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRecognizerTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRecognizerTest.java
index 2639151c8bd..7d6543ea873 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRecognizerTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRecognizerTest.java
@@ -33,61 +33,61 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class DatabaseTypeRecognizerTest {
-
+
@Test
public void assertGetH2DatabaseType() throws SQLException {
DataSource datasource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
Collection<DataSource> dataSources = Collections.singleton(datasource);
assertThat(DatabaseTypeRecognizer.getDatabaseType(dataSources).getName(), is("H2"));
}
-
+
@Test
public void assertGetMariaDBDatabaseType() throws SQLException {
DataSource datasource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("MariaDB"));
Collection<DataSource> dataSources = Collections.singleton(datasource);
assertThat(DatabaseTypeRecognizer.getDatabaseType(dataSources).getName(), is("MariaDB"));
}
-
+
@Test
public void assertGetMySQLDatabaseType() throws SQLException {
DataSource datasource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
Collection<DataSource> dataSources = Collections.singleton(datasource);
assertThat(DatabaseTypeRecognizer.getDatabaseType(dataSources).getName(), is("MySQL"));
}
-
+
@Test
public void assertGetOracleDatabaseType() throws SQLException {
DataSource datasource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
Collection<DataSource> dataSources = Collections.singleton(datasource);
assertThat(DatabaseTypeRecognizer.getDatabaseType(dataSources).getName(), is("Oracle"));
}
-
+
@Test
public void assertGetPostgreSQLDatabaseType() throws SQLException {
DataSource datasource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL"));
Collection<DataSource> dataSources = Collections.singleton(datasource);
assertThat(DatabaseTypeRecognizer.getDatabaseType(dataSources).getName(), is("PostgreSQL"));
}
-
+
@Test
public void assertGetSQL92DatabaseType() throws SQLException {
DataSource datasource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("SQL92"));
Collection<DataSource> dataSources = Collections.singleton(datasource);
assertThat(DatabaseTypeRecognizer.getDatabaseType(dataSources).getName(), is("SQL92"));
}
-
+
@Test
public void assertGetSQLServerDatabaseType() throws SQLException {
DataSource datasource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
Collection<DataSource> dataSources = Collections.singleton(datasource);
assertThat(DatabaseTypeRecognizer.getDatabaseType(dataSources).getName(), is("SQLServer"));
}
-
+
@Test
public void assertGetDefaultDatabaseType() {
assertThat(DatabaseTypeRecognizer.getDatabaseType(Collections.emptyList()).getName(), is("MySQL"));
}
-
+
@Test
public void assertGetDatabaseTypeFromSameDataSources() throws SQLException {
DataSource datasource1 = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
@@ -95,7 +95,7 @@ public final class DatabaseTypeRecognizerTest {
Collection<DataSource> sameDataSources = Arrays.asList(datasource1, datasource2);
assertThat(DatabaseTypeRecognizer.getDatabaseType(sameDataSources).getName(), is("MySQL"));
}
-
+
@Test(expected = IllegalStateException.class)
public void assertGetDatabaseTypeFromDifferentDataSources() throws SQLException {
DataSource datasource1 = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
@@ -103,14 +103,14 @@ public final class DatabaseTypeRecognizerTest {
Collection<DataSource> differentDataSources = Arrays.asList(datasource1, datasource2);
DatabaseTypeRecognizer.getDatabaseType(differentDataSources);
}
-
+
@Test(expected = IllegalArgumentException.class)
public void assertCantGetConnectionFromDataSource() throws SQLException {
DataSource mockDataSource = mock(DataSource.class);
when(mockDataSource.getConnection()).thenThrow(SQLException.class);
DatabaseTypeRecognizer.getDatabaseType(Arrays.asList(mockDataSource));
}
-
+
private DataSource mockDataSource(final DatabaseType databaseType) throws SQLException {
DataSource result = mock(DataSource.class);
Connection connection = mock(Connection.class, RETURNS_DEEP_STUBS);
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/datanode/DataNodeTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/datanode/DataNodeTest.java
index 97e2facf17d..3f2c13c1a1d 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/datanode/DataNodeTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/datanode/DataNodeTest.java
@@ -69,12 +69,12 @@ public final class DataNodeTest {
public void assertToString() {
assertThat(new DataNode("ds_0.tbl_0").toString(), is("DataNode(dataSourceName=ds_0, tableName=tbl_0)"));
}
-
+
@Test(expected = ShardingSphereConfigurationException.class)
public void assertEmptyDataSourceDataNode() {
new DataNode(".tbl_0");
}
-
+
@Test(expected = ShardingSphereConfigurationException.class)
public void assertEmptyTableDataNode() {
new DataNode("ds_0.");
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/instance/InstanceContextTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/instance/InstanceContextTest.java
index cf90b4e3e8a..59d5f32403e 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/instance/InstanceContextTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/instance/InstanceContextTest.java
@@ -40,9 +40,9 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class InstanceContextTest {
-
+
private final ModeConfiguration modeConfiguration = new ModeConfiguration("Memory", null, false);
-
+
private final LockContext lockContext = mock(LockContext.class);
@Test
@@ -59,7 +59,7 @@ public final class InstanceContextTest {
actual = context.getInstance().getState().getCurrentState();
assertThat(actual, is(StateType.OK));
}
-
+
@Test
public void assertUpdateWorkerId() {
InstanceContext context = new InstanceContext(new ComputeNodeInstance(mock(InstanceDefinition.class)), new WorkerIdGeneratorFixture(Long.MIN_VALUE), modeConfiguration, lockContext);
@@ -71,7 +71,7 @@ public final class InstanceContextTest {
actual = context.getWorkerId();
assertThat(actual, is(expected));
}
-
+
@Test
public void assertUpdateLabel() {
InstanceDefinition instanceDefinition = mock(InstanceDefinition.class);
@@ -82,7 +82,7 @@ public final class InstanceContextTest {
Collection<String> actual = context.getInstance().getLabels();
assertThat(actual, is(expected));
}
-
+
@Test
public void assertGetInstance() {
ComputeNodeInstance expected = new ComputeNodeInstance(mock(InstanceDefinition.class));
@@ -90,14 +90,14 @@ public final class InstanceContextTest {
ComputeNodeInstance actual = context.getInstance();
assertThat(actual, is(expected));
}
-
+
@Test
public void assertGetState() {
InstanceContext context = new InstanceContext(new ComputeNodeInstance(mock(InstanceDefinition.class)), new WorkerIdGeneratorFixture(Long.MIN_VALUE), modeConfiguration, lockContext);
StateContext actual = context.getInstance().getState();
assertNotNull(actual);
}
-
+
@Test
public void assertGetWorkerIdGenerator() {
WorkerIdGeneratorFixture expected = new WorkerIdGeneratorFixture(Long.MIN_VALUE);
@@ -105,7 +105,7 @@ public final class InstanceContextTest {
WorkerIdGeneratorFixture actual = (WorkerIdGeneratorFixture) context.getWorkerIdGenerator();
assertThat(actual, is(expected));
}
-
+
@Test
public void assertGetModeConfiguration() {
InstanceContext context = new InstanceContext(new ComputeNodeInstance(mock(InstanceDefinition.class)), new WorkerIdGeneratorFixture(Long.MIN_VALUE), modeConfiguration, lockContext);
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/instance/fixture/WorkerIdGeneratorFixture.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/instance/fixture/WorkerIdGeneratorFixture.java
index 94c6c94a889..7f72b3d5d2c 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/instance/fixture/WorkerIdGeneratorFixture.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/instance/fixture/WorkerIdGeneratorFixture.java
@@ -22,12 +22,11 @@ import org.apache.shardingsphere.infra.instance.workerid.WorkerIdGenerator;
@RequiredArgsConstructor
public final class WorkerIdGeneratorFixture implements WorkerIdGenerator {
-
+
private final long fixtureWorkerId;
-
+
@Override
public long generate() {
return fixtureWorkerId;
}
}
-
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleMetaDataTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleMetaDataTest.java
index e392e191eff..79b8220edd0 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleMetaDataTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/rule/ShardingSphereRuleMetaDataTest.java
@@ -31,31 +31,31 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public final class ShardingSphereRuleMetaDataTest {
-
+
private Collection<RuleConfiguration> configurations;
-
+
private Collection<ShardingSphereRule> rules;
-
+
private ShardingSphereRuleMetaData shardingSphereRuleMetaData;
-
+
@Before
public void init() {
rules = Arrays.asList(new ShardingSphereRuleFixture());
shardingSphereRuleMetaData = new ShardingSphereRuleMetaData(configurations, rules);
}
-
+
@Test
public void assertFilterRulesReturnOneItem() {
Collection<ShardingSphereRuleFixture> clazzList = shardingSphereRuleMetaData.findRules(ShardingSphereRuleFixture.class);
assertThat(1, equalTo(clazzList.size()));
}
-
+
@Test
public void assertFindSingleRuleReturnsIsPresent() {
Optional<ShardingSphereRuleFixture> clazzOptional = shardingSphereRuleMetaData.findSingleRule(ShardingSphereRuleFixture.class);
assertTrue(clazzOptional.isPresent());
}
-
+
@Test
public void assertFindSingleRuleHasValue() {
Optional<ShardingSphereRuleFixture> clazzOptional = shardingSphereRuleMetaData.findSingleRule(ShardingSphereRuleFixture.class);
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/loader/spi/DialectTableMetaDataLoaderFactoryTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/loader/spi/DialectTableMetaDataLoaderFactoryTest.java
index d0024dd02cf..3a7f198fdb4 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/loader/spi/DialectTableMetaDataLoaderFactoryTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/schema/loader/spi/DialectTableMetaDataLoaderFactoryTest.java
@@ -36,7 +36,7 @@ import java.util.Optional;
import static org.junit.Assert.assertTrue;
public final class DialectTableMetaDataLoaderFactoryTest {
-
+
@Test
public void assertNewInstanceWithH2TableMetaDataLoader() {
H2DatabaseType h2DatabaseType = new H2DatabaseType();
@@ -44,7 +44,7 @@ public final class DialectTableMetaDataLoaderFactoryTest {
assertTrue(h2TableMetaDataLoader.isPresent());
assertTrue(h2TableMetaDataLoader.get() instanceof H2TableMetaDataLoader);
}
-
+
@Test
public void assertNewInstanceWithOracleTableMetaDataLoader() {
OracleDatabaseType oracleDatabaseType = new OracleDatabaseType();
@@ -52,7 +52,7 @@ public final class DialectTableMetaDataLoaderFactoryTest {
assertTrue(oracleTableMetaDataLoader.isPresent());
assertTrue(oracleTableMetaDataLoader.get() instanceof OracleTableMetaDataLoader);
}
-
+
@Test
public void assertNewInstanceWithSQLServerTableMetaDataLoader() {
SQLServerDatabaseType sqlServerDatabaseType = new SQLServerDatabaseType();
@@ -60,7 +60,7 @@ public final class DialectTableMetaDataLoaderFactoryTest {
assertTrue(sQLServerTableMetaDataLoader.isPresent());
assertTrue(sQLServerTableMetaDataLoader.get() instanceof SQLServerTableMetaDataLoader);
}
-
+
@Test
public void assertNewInstanceWithOpenGaussDatabaseType() {
OpenGaussDatabaseType openGaussDatabaseType = new OpenGaussDatabaseType();
@@ -68,7 +68,7 @@ public final class DialectTableMetaDataLoaderFactoryTest {
assertTrue(openGaussTableMetaDataLoader.isPresent());
assertTrue(openGaussTableMetaDataLoader.get() instanceof OpenGaussTableMetaDataLoader);
}
-
+
@Test
public void assertNewInstanceWithMySQLTableMetaDataLoader() {
MySQLDatabaseType mySQLDatabaseType = new MySQLDatabaseType();
@@ -76,7 +76,7 @@ public final class DialectTableMetaDataLoaderFactoryTest {
assertTrue(mySQLTableMetaDataLoader.isPresent());
assertTrue(mySQLTableMetaDataLoader.get() instanceof MySQLTableMetaDataLoader);
}
-
+
@Test
public void assertNewInstanceWithPostgreSQLTableMetaDataLoader() {
PostgreSQLDatabaseType postgreSQLDatabaseType = new PostgreSQLDatabaseType();
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/user/ShardingSphereUsersTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/user/ShardingSphereUsersTest.java
index e83f39eeca0..caf32a8f423 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/user/ShardingSphereUsersTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/user/ShardingSphereUsersTest.java
@@ -29,7 +29,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ShardingSphereUsersTest {
-
+
@Test
public void assertFindUser() {
Collection<ShardingSphereUser> shardingSphereUserCollection = new LinkedList<>();
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/YamlRuleConfigurationSwapperFactoryTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/YamlRuleConfigurationSwapperFactoryTest.java
index eaa09e96679..4f3d1d98d16 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/YamlRuleConfigurationSwapperFactoryTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/YamlRuleConfigurationSwapperFactoryTest.java
@@ -31,7 +31,7 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public final class YamlRuleConfigurationSwapperFactoryTest {
-
+
@Test
public void newInstanceMapByRuleConfigurations() {
RuleConfigurationFixture ruleConfigurationFixture = new RuleConfigurationFixture();
@@ -39,14 +39,14 @@ public final class YamlRuleConfigurationSwapperFactoryTest {
.newInstanceMapByRuleConfigurations(Collections.singletonList(ruleConfigurationFixture));
assertTrue(yamlRuleConfigurationSwapperMap.get(ruleConfigurationFixture) instanceof YamlRuleConfigurationSwapperFixture);
}
-
+
@Test
public void newInstanceMapByRuleConfigurationClasses() {
Map<Class<?>, YamlRuleConfigurationSwapper> yamlRuleConfigurationSwapperMap = YamlRuleConfigurationSwapperFactory
.newInstanceMapByRuleConfigurationClasses(Collections.singletonList(RuleConfigurationFixture.class));
assertTrue(yamlRuleConfigurationSwapperMap.get(RuleConfigurationFixture.class) instanceof YamlRuleConfigurationSwapperFixture);
}
-
+
@Test
public void newInstances() {
Collection<YamlRuleConfigurationSwapper> yamlRuleConfigurationSwappers = YamlRuleConfigurationSwapperFactory.newInstances();
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapperTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapperTest.java
index 82aed70c77c..4df9c36a74e 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapperTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapperTest.java
@@ -36,17 +36,17 @@ public final class ModeConfigurationYamlSwapperTest {
public void swapToYamlConfiguration() {
ModeConfiguration modeConfiguration = new ModeConfiguration("TEST_TYPE", null, true);
YamlModeConfiguration actual = swapper.swapToYamlConfiguration(modeConfiguration);
- assertThat(actual.getType(), is(TEST_TYPE));
+ assertThat(actual.getType(), is(TEST_TYPE));
assertTrue(actual.isOverwrite());
}
@Test
public void swapToObject() {
- YamlModeConfiguration yamlConfig = new YamlModeConfiguration();
+ YamlModeConfiguration yamlConfig = new YamlModeConfiguration();
yamlConfig.setType(TEST_TYPE);
- yamlConfig.setOverwrite(false);
+ yamlConfig.setOverwrite(false);
ModeConfiguration actual = swapper.swapToObject(yamlConfig);
- assertThat(actual.getType(), is(TEST_TYPE));
+ assertThat(actual.getType(), is(TEST_TYPE));
assertFalse(actual.isOverwrite());
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/kernel/thread/ExecutorThreadFactoryBuilderTest.java b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/kernel/thread/ExecutorThreadFactoryBuilderTest.java
index 8c0a55fdaad..cf68f574282 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/kernel/thread/ExecutorThreadFactoryBuilderTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/kernel/thread/ExecutorThreadFactoryBuilderTest.java
@@ -29,16 +29,19 @@ public final class ExecutorThreadFactoryBuilderTest {
@Test
public void assertBuild() {
ThreadFactory threadFactory = ExecutorThreadFactoryBuilder.build();
- Thread thread0 = threadFactory.newThread(() -> { });
+ Thread thread0 = threadFactory.newThread(() -> {
+ });
assertThat(thread0.getName(), is("ShardingSphere-0"));
- Thread thread1 = threadFactory.newThread(() -> { });
+ Thread thread1 = threadFactory.newThread(() -> {
+ });
assertThat(thread1.getName(), is("ShardingSphere-1"));
}
@Test
public void assertBuildWithNameFormat() {
ThreadFactory threadFactory = ExecutorThreadFactoryBuilder.build("test");
- Thread thread = threadFactory.newThread(() -> { });
+ Thread thread = threadFactory.newThread(() -> {
+ });
assertThat(thread.getName(), is("ShardingSphere-test"));
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/generator/builder/DefaultTokenGeneratorBuilderTest.java b/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/generator/builder/DefaultTokenGeneratorBuilderTest.java
index 373ad904943..b287cafd01c 100644
--- a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/generator/builder/DefaultTokenGeneratorBuilderTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/generator/builder/DefaultTokenGeneratorBuilderTest.java
@@ -36,21 +36,21 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class DefaultTokenGeneratorBuilderTest {
-
+
@Test
public void assertGetSQLTokenGeneratorsWithShowTableStatus() {
ShowTableStatusStatementContext sqlStatementContext = mock(ShowTableStatusStatementContext.class, RETURNS_DEEP_STUBS);
when(sqlStatementContext.getRemoveSegments().isEmpty()).thenReturn(false);
assertGetSQLTokenGenerators(sqlStatementContext);
}
-
+
@Test
public void assertGetSQLTokenGeneratorsWithSelect() {
SelectStatementContext sqlStatementContext = mock(SelectStatementContext.class, RETURNS_DEEP_STUBS);
when(sqlStatementContext.getTablesContext().getDatabaseName().isPresent()).thenReturn(true);
assertGetSQLTokenGenerators(sqlStatementContext);
}
-
+
@Test
public void assertGetSQLTokenGeneratorsWithShowColumns() {
ShowColumnsStatementContext sqlStatementContext = mock(ShowColumnsStatementContext.class, RETURNS_DEEP_STUBS);
@@ -58,7 +58,7 @@ public final class DefaultTokenGeneratorBuilderTest {
when(sqlStatementContext.getTablesContext().getDatabaseName().isPresent()).thenReturn(true);
assertGetSQLTokenGenerators(sqlStatementContext);
}
-
+
private void assertGetSQLTokenGenerators(final SQLStatementContext sqlStatementContext) {
DefaultTokenGeneratorBuilder defaultTokenGeneratorBuilder = new DefaultTokenGeneratorBuilder(sqlStatementContext);
Collection<SQLTokenGenerator> sqlTokenGenerators = defaultTokenGeneratorBuilder.getSQLTokenGenerators();
diff --git a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/OwnerTokenTest.java b/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/OwnerTokenTest.java
index 3f702781ece..dcb66671d44 100644
--- a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/OwnerTokenTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/sql/token/pojo/generic/OwnerTokenTest.java
@@ -63,14 +63,14 @@ public final class OwnerTokenTest {
assertThat(ownerToken.toString(), is(""));
assertTokenGrid(ownerToken);
}
-
+
@Test
public void assertOwnerTokenWithNoRouteUnitAndOwnerNameIsEmpty() {
OwnerToken ownerToken = new OwnerToken(0, 1, null, new IdentifierValue("t_user_detail"));
assertThat(ownerToken.toString(), is(""));
assertTokenGrid(ownerToken);
}
-
+
private void assertTokenGrid(final OwnerToken ownerToken) {
assertThat(ownerToken.getStartIndex(), is(0));
assertThat(ownerToken.getStopIndex(), is(1));
diff --git a/shardingsphere-infra/shardingsphere-infra-route/src/test/java/org/apache/shardingsphere/infra/route/engine/AllSQLRouteExecutorTest.java b/shardingsphere-infra/shardingsphere-infra-route/src/test/java/org/apache/shardingsphere/infra/route/engine/AllSQLRouteExecutorTest.java
index 1807a7828f8..31c9b540e8c 100644
--- a/shardingsphere-infra/shardingsphere-infra-route/src/test/java/org/apache/shardingsphere/infra/route/engine/AllSQLRouteExecutorTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-route/src/test/java/org/apache/shardingsphere/infra/route/engine/AllSQLRouteExecutorTest.java
@@ -38,7 +38,7 @@ import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public final class AllSQLRouteExecutorTest {
-
+
@Test
public void assertRouteSuccess() {
String name = "test";
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetAdapterTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetAdapterTest.java
index b8083207979..ceb9dc5d6da 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetAdapterTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetAdapterTest.java
@@ -109,7 +109,7 @@ public final class ResultSetAdapterTest {
ShardingSphereResultSet actual = mockShardingSphereResultSet(resultSet);
assertThat(actual.findColumn("col"), is(1));
}
-
+
private ShardingSphereResultSet mockShardingSphereResultSet(final ResultSet resultSet) throws SQLException {
ResultSetMetaData resultSetMetaData = mock(ResultSetMetaData.class);
when(resultSetMetaData.getColumnLabel(1)).thenReturn("col");
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/DatabaseMetaDataResultSetTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/DatabaseMetaDataResultSetTest.java
index 5b60ae204df..4e8f5158c85 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/DatabaseMetaDataResultSetTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/DatabaseMetaDataResultSetTest.java
@@ -169,7 +169,7 @@ public final class DatabaseMetaDataResultSetTest {
assertThat(databaseMetaDataResultSet.getString(NUMBER_COLUMN_LABEL), is("100"));
assertThat(databaseMetaDataResultSet.getString(INDEX_NAME_COLUMN_LABEL), is(LOGIC_INDEX_NAME));
}
-
+
@Test
public void assertGetStringWithLabelCaseInsensitive() throws SQLException {
databaseMetaDataResultSet.next();
@@ -178,7 +178,7 @@ public final class DatabaseMetaDataResultSetTest {
assertThat(databaseMetaDataResultSet.getString(NUMBER_COLUMN_LABEL.toLowerCase()), is("100"));
assertThat(databaseMetaDataResultSet.getString(INDEX_NAME_COLUMN_LABEL.toLowerCase()), is(LOGIC_INDEX_NAME));
}
-
+
@Test
public void assertGetNStringWithIndex() throws SQLException {
databaseMetaDataResultSet.next();
@@ -187,7 +187,7 @@ public final class DatabaseMetaDataResultSetTest {
assertThat(databaseMetaDataResultSet.getNString(3), is("100"));
assertThat(databaseMetaDataResultSet.getNString(6), is(LOGIC_INDEX_NAME));
}
-
+
@Test
public void assertGetNStringWithLabel() throws SQLException {
databaseMetaDataResultSet.next();
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/GeneratedKeysResultSetTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/GeneratedKeysResultSetTest.java
index a1aadc581bf..5064c0fa294 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/GeneratedKeysResultSetTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/GeneratedKeysResultSetTest.java
@@ -82,7 +82,7 @@ public final class GeneratedKeysResultSetTest {
assertThat(actualResultSet.getString("order_id"), is("2"));
assertFalse(actualResultSet.next());
}
-
+
@Test
public void assertGetNString() {
assertTrue(actualResultSet.next());
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtilTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtilTest.java
index c04e36f6edd..93d4cfa7185 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtilTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtilTest.java
@@ -65,7 +65,7 @@ public final class ResultSetUtilTest {
assertThat(ResultSetUtil.convertValue(timestamp, LocalDate.class), is(LocalDate.of(2021, Month.DECEMBER, 23)));
assertThat(ResultSetUtil.convertValue(timestamp, LocalTime.class), is(LocalTime.of(19, 30)));
}
-
+
@Test
public void assertConvertBooleanValue() throws SQLException {
String dbFalse = "-2";
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ShardingSphereResultSetTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ShardingSphereResultSetTest.java
index 587a5f9217d..774498e5f02 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ShardingSphereResultSetTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ShardingSphereResultSetTest.java
@@ -214,13 +214,13 @@ public final class ShardingSphereResultSetTest {
when(mergeResultSet.getValue(1, String.class)).thenReturn("value");
assertThat(shardingSphereResultSet.getString("label"), is("value"));
}
-
+
@Test
public void assertGetNStringWithColumnIndex() throws SQLException {
when(mergeResultSet.getValue(1, String.class)).thenReturn("value");
assertThat(shardingSphereResultSet.getNString(1), is("value"));
}
-
+
@Test
public void assertGetNStringWithColumnLabel() throws SQLException {
when(mergeResultSet.getValue(1, String.class)).thenReturn("value");
@@ -498,7 +498,7 @@ public final class ShardingSphereResultSetTest {
Byte result = new Byte((byte) 1);
when(mergeResultSet.getValue(1, byte.class)).thenReturn(result);
assertThat(shardingSphereResultSet.getObject(1, byte.class), is(result));
- }
+ }
@Test
public void assertGetObjectWithByteArray() throws SQLException {
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptStatementTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptStatementTest.java
index fd05c7019ac..9c2acca41ae 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptStatementTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptStatementTest.java
@@ -195,7 +195,7 @@ public final class EncryptStatementTest extends AbstractShardingSphereDataSource
statement.executeQuery("");
}
}
-
+
@Test
public void assertShowColumnsTable() throws SQLException {
try (Statement statement = getEncryptConnection().createStatement()) {
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatementTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatementTest.java
index 7720b769af8..ef4e9fe14f5 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatementTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatementTest.java
@@ -89,7 +89,7 @@ public final class ShardingSphereStatementTest extends AbstractShardingSphereDat
statement.executeQuery("");
}
}
-
+
@Test
public void assertExecuteGetResultSet() throws SQLException {
String sql = "UPDATE t_order_item SET status = '%s' WHERE user_id = %d AND order_id = %d";
@@ -98,7 +98,7 @@ public final class ShardingSphereStatementTest extends AbstractShardingSphereDat
assertNull(statement.getResultSet());
}
}
-
+
@Test
public void assertExecuteUpdateGetResultSet() throws SQLException {
String sql = "UPDATE t_order_item SET status = '%s' WHERE user_id = %d AND order_id = %d";
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationResultSetTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationResultSetTest.java
index 8d612a5c50d..6cb54fa0184 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationResultSetTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationResultSetTest.java
@@ -70,7 +70,6 @@ public final class UnsupportedOperationResultSetTest {
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertBeforeFirst() throws SQLException {
shardingSphereResultSet.beforeFirst();
-
}
@Test(expected = SQLFeatureNotSupportedException.class)
@@ -192,7 +191,7 @@ public final class UnsupportedOperationResultSetTest {
public void assertGetRefForColumnLabel() throws SQLException {
shardingSphereResultSet.getRef("label");
}
-
+
@Test(expected = SQLFeatureNotSupportedException.class)
public void assertGetRowIdForColumnIndex() throws SQLException {
shardingSphereResultSet.getRowId(1);
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/SpringBootStarterTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/SpringBootStarterTest.java
index 2cf5fe847e8..ac3cd2defa1 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/SpringBootStarterTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/SpringBootStarterTest.java
@@ -160,7 +160,7 @@ public class SpringBootStarterTest {
private void assertShadowAlgorithms(final Map<String, ShadowAlgorithm> actual) {
assertThat(actual.size(), is(3));
assertThat(actual.get("user-id-match-algorithm"), instanceOf(ColumnShadowAlgorithm.class));
- assertThat(actual.get("order-id-match-algorithm"), instanceOf(ColumnShadowAlgorithm.class));
+ assertThat(actual.get("order-id-match-algorithm"), instanceOf(ColumnShadowAlgorithm.class));
assertThat(actual.get("simple-hint-algorithm"), instanceOf(HintShadowAlgorithm.class));
}
@@ -181,7 +181,7 @@ public class SpringBootStarterTest {
assertCacheOption(actual.getSqlStatementCache());
assertCacheOption(actual.getParseTreeCache());
}
-
+
private void assertCacheOption(final CacheOption actual) {
assertThat(actual.getInitialCapacity(), is(1024));
assertThat(actual.getMaximumSize(), is(1024L));
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLPositionInitializerTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLPositionInitializerTest.java
index e70ae9d01c5..a5501bbfd46 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLPositionInitializerTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/MySQLPositionInitializerTest.java
@@ -87,4 +87,3 @@ public final class MySQLPositionInitializerTest {
return result;
}
}
-
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/binlog/BinlogContextTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/binlog/BinlogContextTest.java
index e04c51f2d5c..c3ba36cd310 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/binlog/BinlogContextTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/binlog/BinlogContextTest.java
@@ -53,7 +53,7 @@ public final class BinlogContextTest {
when(tableMapEventPacket.getSchemaName()).thenReturn(TEST_SCHEMA);
when(tableMapEventPacket.getTableName()).thenReturn(TEST_TABLE);
}
-
+
@Test
public void assertGetTableName() {
binlogContext.putTableMapEvent(TEST_TABLE_ID, tableMapEventPacket);
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/column/value/MySQLDataTypeHandlerFactoryTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/column/value/MySQLDataTypeHandlerFactoryTest.java
index f27cadccfa5..029d2413b02 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/column/value/MySQLDataTypeHandlerFactoryTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/ingest/column/value/MySQLDataTypeHandlerFactoryTest.java
@@ -30,35 +30,35 @@ import java.util.Optional;
import static org.junit.Assert.assertTrue;
public final class MySQLDataTypeHandlerFactoryTest {
-
+
@Test
public void assertNewInstanceWithMySQLUnsignedTinyintHandler() {
Optional<MySQLDataTypeHandler> mySQLUnsignedTinyintHandler = MySQLDataTypeHandlerFactory.newInstance("TINYINT UNSIGNED");
assertTrue(mySQLUnsignedTinyintHandler.isPresent());
assertTrue(mySQLUnsignedTinyintHandler.get() instanceof MySQLUnsignedTinyintHandler);
}
-
+
@Test
public void assertNewInstanceWithMySQLUnsignedSmallintHandler() {
Optional<MySQLDataTypeHandler> mySQLUnsignedSmallintHandler = MySQLDataTypeHandlerFactory.newInstance("SMALLINT UNSIGNED");
assertTrue(mySQLUnsignedSmallintHandler.isPresent());
assertTrue(mySQLUnsignedSmallintHandler.get() instanceof MySQLUnsignedSmallintHandler);
}
-
+
@Test
public void assertNewInstanceWithMySQLUnsignedMediumintHandler() {
Optional<MySQLDataTypeHandler> mySQLUnsignedMediumintHandler = MySQLDataTypeHandlerFactory.newInstance("MEDIUMINT UNSIGNED");
assertTrue(mySQLUnsignedMediumintHandler.isPresent());
assertTrue(mySQLUnsignedMediumintHandler.get() instanceof MySQLUnsignedMediumintHandler);
}
-
+
@Test
public void assertNewInstanceWithMySQLUnsignedIntHandler() {
Optional<MySQLDataTypeHandler> mySQLUnsignedIntHandler = MySQLDataTypeHandlerFactory.newInstance("INT UNSIGNED");
assertTrue(mySQLUnsignedIntHandler.isPresent());
assertTrue(mySQLUnsignedIntHandler.get() instanceof MySQLUnsignedIntHandler);
}
-
+
@Test
public void assertNewInstanceWithMySQLUnsignedBigintHandler() {
Optional<MySQLDataTypeHandler> mySQLUnsignedBigintHandler = MySQLDataTypeHandlerFactory.newInstance("BIGINT UNSIGNED");
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/prepare/datasource/MySQLDataSourcePreparerTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/prepare/datasource/MySQLDataSourcePreparerTest.java
index ea380a394cf..ccf739ffa5e 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/prepare/datasource/MySQLDataSourcePreparerTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/test/java/org/apache/shardingsphere/data/pipeline/mysql/prepare/datasource/MySQLDataSourcePreparerTest.java
@@ -84,7 +84,7 @@ public final class MySQLDataSourcePreparerTest {
when(pipelineConfig.getTarget().getParameter()).thenReturn("target");
when(prepareTargetTablesParameter.getPipelineConfiguration()).thenReturn(pipelineConfig);
when(prepareTargetTablesParameter.getTablesFirstDataNodes()).thenReturn(new JobDataNodeLine(Collections.emptyList()));
- }
+ }
@Test
public void assertGetConnection() throws SQLException {
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPluginTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPluginTest.java
index abe858e1e44..fc7cf8a925b 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPluginTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-postgresql/src/test/java/org/apache/shardingsphere/data/pipeline/postgresql/ingest/wal/decode/TestDecodingPluginTest.java
@@ -38,9 +38,9 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class TestDecodingPluginTest {
-
+
private final LogSequenceNumber pgSequenceNumber = LogSequenceNumber.valueOf("0/14EFDB8");
-
+
private final PostgreSQLLogSequenceNumber logSequenceNumber = new PostgreSQLLogSequenceNumber(pgSequenceNumber);
@Test
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/PipelineDataSourceWrapperTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/PipelineDataSourceWrapperTest.java
index 441b639a0f2..46479d362e0 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/PipelineDataSourceWrapperTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/PipelineDataSourceWrapperTest.java
@@ -38,25 +38,25 @@ import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public final class PipelineDataSourceWrapperTest {
-
+
private static final String CLIENT_USERNAME = "username";
-
+
private static final String CLIENT_PASSWORD = "password";
-
+
private static final int LOGIN_TIMEOUT = 15;
-
+
@Mock(extraInterfaces = AutoCloseable.class)
private DataSource dataSource;
-
+
@Mock
private Connection connection;
-
+
@Mock
private PrintWriter printWriter;
-
+
@Mock
private Logger parentLogger;
-
+
@Before
public void setUp() throws SQLException {
when(dataSource.getConnection()).thenReturn(connection);
@@ -66,7 +66,7 @@ public final class PipelineDataSourceWrapperTest {
when(dataSource.isWrapperFor(any())).thenReturn(Boolean.TRUE);
when(dataSource.getParentLogger()).thenReturn(parentLogger);
}
-
+
@Test
public void assertGetConnection() throws SQLException {
PipelineDataSourceWrapper dataSourceWrapper = new PipelineDataSourceWrapper(dataSource, new H2DatabaseType());
@@ -77,41 +77,41 @@ public final class PipelineDataSourceWrapperTest {
assertIsWrappedFor(dataSourceWrapper.isWrapperFor(any()));
assertGetParentLogger(dataSourceWrapper.getParentLogger());
}
-
+
private void assertGetLogWriter(final PrintWriter actual) {
assertThat(actual, is(printWriter));
}
-
+
private void assertGetLoginTimeout(final int actual) {
assertThat(actual, is(LOGIN_TIMEOUT));
}
-
+
private void assertIsWrappedFor(final boolean actual) {
assertThat(actual, is(Boolean.TRUE));
}
-
+
private void assertGetParentLogger(final Logger actual) {
assertThat(actual, is(parentLogger));
}
-
+
@Test(expected = SQLException.class)
public void assertSetLoginTimeoutFailure() throws SQLException {
doThrow(new SQLException("")).when(dataSource).setLoginTimeout(LOGIN_TIMEOUT);
new PipelineDataSourceWrapper(dataSource, new H2DatabaseType()).setLoginTimeout(LOGIN_TIMEOUT);
}
-
+
@Test(expected = SQLException.class)
public void assertSetLogWriterFailure() throws SQLException {
doThrow(new SQLException("")).when(dataSource).setLogWriter(printWriter);
new PipelineDataSourceWrapper(dataSource, new H2DatabaseType()).setLogWriter(printWriter);
}
-
+
@Test(expected = SQLException.class)
public void assertCloseExceptionFailure() throws Exception {
doThrow(new Exception("")).when((AutoCloseable) dataSource).close();
new PipelineDataSourceWrapper(dataSource, new H2DatabaseType()).close();
}
-
+
@Test(expected = SQLException.class)
public void assertCloseSQLExceptionFailure() throws Exception {
doThrow(new SQLException("")).when((AutoCloseable) dataSource).close();
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/config/impl/ShardingSpherePipelineDataSourceConfigurationTest.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/config/impl/ShardingSpherePipelineDataSourceConfigurationTest.java
index 26684b0dfb4..6065be01232 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/config/impl/ShardingSpherePipelineDataSourceConfigurationTest.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-spi/src/test/java/org/apache/shardingsphere/data/pipeline/api/datasource/config/impl/ShardingSpherePipelineDataSourceConfigurationTest.java
@@ -60,7 +60,7 @@ public final class ShardingSpherePipelineDataSourceConfigurationTest {
yamlDataSourceConfigs.forEach((key, value) -> result.put(key, new YamlDataSourceConfigurationSwapper().swapToDataSourceProperties(value)));
return result;
}
-
+
@Test
public void assertDataSourceCanBeAggregation() throws InvalidDataSourcePropertiesException {
ShardingSpherePipelineDataSourceConfiguration dataSourceConfig = new ShardingSpherePipelineDataSourceConfiguration(getDataSourceAggregationYaml());
@@ -68,7 +68,7 @@ public final class ShardingSpherePipelineDataSourceConfigurationTest {
assertTrue(actual.get(0).isInSameDatabaseInstance(actual.get(0).getAllLocalProperties().get("jdbcUrl").toString(), actual.get(1).getAllLocalProperties().get("jdbcUrl").toString()));
actual.get(0).checkToBeAggregatedDataSources(actual.get(1));
}
-
+
private String getDataSourceAggregationYaml() {
return "dataSources:\n"
+ " ds_1:\n"
diff --git a/shardingsphere-kernel/shardingsphere-parser/shardingsphere-parser-spring/shardingsphere-parser-spring-namespace/src/test/java/org/apache/shardingsphere/parser/spring/namespace/SQLParserSpringNamespaceTest.java b/shardingsphere-kernel/shardingsphere-parser/shardingsphere-parser-spring/shardingsphere-parser-spring-namespace/src/test/java/org/apache/shardingsphere/parser/spring/namespace/SQLParserSpringNamespaceTest.java
index 74ad81da46f..7761b504049 100644
--- a/shardingsphere-kernel/shardingsphere-parser/shardingsphere-parser-spring/shardingsphere-parser-spring-namespace/src/test/java/org/apache/shardingsphere/parser/spring/namespace/SQLParserSpringNamespaceTest.java
+++ b/shardingsphere-kernel/shardingsphere-parser/shardingsphere-parser-spring/shardingsphere-parser-spring-namespace/src/test/java/org/apache/shardingsphere/parser/spring/namespace/SQLParserSpringNamespaceTest.java
@@ -40,7 +40,7 @@ public final class SQLParserSpringNamespaceTest extends AbstractJUnit4SpringCont
assertCacheOption(sqlParserRuleConfiguration.getSqlStatementCache());
assertCacheOption(sqlParserRuleConfiguration.getParseTreeCache());
}
-
+
private void assertCacheOption(final CacheOption cacheOption) {
assertThat(cacheOption.getInitialCapacity(), is(1024));
assertThat(cacheOption.getMaximumSize(), is(1024L));
diff --git a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/DefaultSingleTableSchemaRuleConfigurationBuilderTest.java b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/DefaultSingleTableSchemaRuleConfigurationBuilderTest.java
index 9eb89146ea0..d48689fdc21 100644
--- a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/DefaultSingleTableSchemaRuleConfigurationBuilderTest.java
+++ b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/DefaultSingleTableSchemaRuleConfigurationBuilderTest.java
@@ -31,11 +31,11 @@ import static org.junit.Assert.assertThat;
@RunWith(MockitoJUnitRunner.class)
public final class DefaultSingleTableSchemaRuleConfigurationBuilderTest {
-
+
static {
ShardingSphereServiceLoader.register(DefaultSchemaRuleConfigurationBuilder.class);
}
-
+
@Test
public void assertBuild() {
Collection<DefaultSchemaRuleConfigurationBuilder> registeredServices = OrderedSPIRegistry.getRegisteredServices(DefaultSchemaRuleConfigurationBuilder.class);
diff --git a/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/test/java/org/apache/shardingsphere/traffic/yaml/swapper/TrafficStrategyConfigurationYamlSwapperTest.java b/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/test/java/org/apache/shardingsphere/traffic/yaml/swapper/TrafficStrategyConfigurationYamlSwapperTest.java
index dbfd86a819c..19c6e980f2b 100644
--- a/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/test/java/org/apache/shardingsphere/traffic/yaml/swapper/TrafficStrategyConfigurationYamlSwapperTest.java
+++ b/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/test/java/org/apache/shardingsphere/traffic/yaml/swapper/TrafficStrategyConfigurationYamlSwapperTest.java
@@ -31,21 +31,21 @@ import static org.junit.Assert.assertThat;
@RunWith(MockitoJUnitRunner.class)
public final class TrafficStrategyConfigurationYamlSwapperTest {
-
+
private static final String NAME = "testName";
-
+
private static final String TEST_LABEL_ONE = "testLabelOne";
-
+
private static final String TEST_LABEL_TWO = "testLabelTwo";
-
+
private static final String ALGORITHM_NAME = "algorithmName";
-
+
private static final String LOAD_BALANCER_NAME = "testLoadBalancerName";
-
+
private static final List<String> LABELS = Lists.newArrayList(TEST_LABEL_ONE, TEST_LABEL_TWO);
-
+
private final TrafficStrategyConfigurationYamlSwapper yamlSwapper = new TrafficStrategyConfigurationYamlSwapper();
-
+
@Test
public void swapToYamlConfiguration() {
YamlTrafficStrategyConfiguration yamlTrafficStrategyConfiguration = yamlSwapper.swapToYamlConfiguration(createTrafficStrategyConfiguration());
@@ -54,11 +54,11 @@ public final class TrafficStrategyConfigurationYamlSwapperTest {
assertThat(yamlTrafficStrategyConfiguration.getAlgorithmName(), is(ALGORITHM_NAME));
assertThat(yamlTrafficStrategyConfiguration.getLoadBalancerName(), is(LOAD_BALANCER_NAME));
}
-
+
private TrafficStrategyConfiguration createTrafficStrategyConfiguration() {
return new TrafficStrategyConfiguration(NAME, LABELS, ALGORITHM_NAME, LOAD_BALANCER_NAME);
}
-
+
@Test
public void swapToObject() {
TrafficStrategyConfiguration trafficStrategyConfiguration = yamlSwapper.swapToObject(createYamlTrafficStrategyConfiguration());
@@ -67,7 +67,7 @@ public final class TrafficStrategyConfigurationYamlSwapperTest {
assertThat(trafficStrategyConfiguration.getAlgorithmName(), is(ALGORITHM_NAME));
assertThat(trafficStrategyConfiguration.getLoadBalancerName(), is(LOAD_BALANCER_NAME));
}
-
+
private YamlTrafficStrategyConfiguration createYamlTrafficStrategyConfiguration() {
YamlTrafficStrategyConfiguration result = new YamlTrafficStrategyConfiguration();
result.setName(NAME);
diff --git a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/core/fixture/OtherShardingSphereTransactionManagerFixture.java b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/core/fixture/OtherShardingSphereTransactionManagerFixture.java
index 9741da43377..a9bdd8b856a 100644
--- a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/core/fixture/OtherShardingSphereTransactionManagerFixture.java
+++ b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/core/fixture/OtherShardingSphereTransactionManagerFixture.java
@@ -50,11 +50,11 @@ public final class OtherShardingSphereTransactionManagerFixture implements Shard
@Override
public void begin() {
}
-
+
@Override
public void begin(final int timeout) {
}
-
+
@Override
public void commit(final boolean rollbackOnly) {
}
diff --git a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/core/fixture/ShardingSphereTransactionManagerFixture.java b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/core/fixture/ShardingSphereTransactionManagerFixture.java
index f7f47cba1b5..234d68e383f 100644
--- a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/core/fixture/ShardingSphereTransactionManagerFixture.java
+++ b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/core/fixture/ShardingSphereTransactionManagerFixture.java
@@ -55,11 +55,11 @@ public final class ShardingSphereTransactionManagerFixture implements ShardingSp
@Override
public void begin() {
}
-
+
@Override
public void begin(final int timeout) {
}
-
+
@Override
public void commit(final boolean rollbackOnly) {
}
diff --git a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactoryTest.java b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFacto [...]
index d9be5616f76..b675f568792 100644
--- a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactoryTest.java
+++ b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactoryTest.java
@@ -45,13 +45,13 @@ public final class XADataSourceFactoryTest {
XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("H2"), dataSource);
assertThat(xaDataSource, instanceOf(JdbcDataSource.class));
}
-
+
@Test
public void assertCreateMariaDBXADataSource() {
XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("MariaDB"), dataSource);
assertThat(xaDataSource, instanceOf(MariaDbDataSource.class));
}
-
+
@Test
public void assertCreatePGXADataSource() {
when(dataSource.getJdbcUrl()).thenReturn("jdbc:postgresql://localhost:5432/db1");
diff --git a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransactionDataSourceTest.java b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransaction [...]
index 65cd5b5d184..1b28dadc842 100644
--- a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransactionDataSourceTest.java
+++ b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransactionDataSourceTest.java
@@ -92,7 +92,6 @@ public final class XATransactionDataSourceTest {
XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"), "ds11", dataSource, xaTransactionManagerProvider);
transactionDataSource.close();
verify(xaTransactionManagerProvider, times(0)).removeRecoveryResource(anyString(), any(XADataSource.class));
-
}
@Test
diff --git a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactoryTest.java b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasou [...]
index 77867818993..979602c0026 100644
--- a/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactoryTest.java
+++ b/shardingsphere-kernel/shardingsphere-transaction/shardingsphere-transaction-type/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactoryTest.java
@@ -40,7 +40,7 @@ public final class XADataSourceDefinitionFactoryTest {
public void assertCreateXAPropertiesForMySQL() {
assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypeRegistry.getActualDatabaseType("MySQL")), instanceOf(MySQLXADataSourceDefinition.class));
}
-
+
@Test
public void assertCreateXAPropertiesForMariaDB() {
assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypeRegistry.getActualDatabaseType("MariaDB")), instanceOf(MariaDBXADataSourceDefinition.class));
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerBuilderParameterTest.java b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerBuilderParameterTest.java
index 8c866fadce1..da6b24818f7 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerBuilderParameterTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerBuilderParameterTest.java
@@ -36,7 +36,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class ContextManagerBuilderParameterTest {
-
+
@Test
public void assertIsEmpty() {
Map<String, DatabaseConfiguration> mockDatabaseConfigs = getMockSchemaConfiguration(true, true);
@@ -47,7 +47,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertTrue(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
public void assertIsEmptyWhenAllFieldIsEmpty() {
ContextManagerBuilderParameter contextManagerBuilderParameter = ContextManagerBuilderParameter.builder()
@@ -57,7 +57,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertTrue(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
@SuppressWarnings("unchecked")
public void assertIsEmptyWhenAllFieldIsNotEmpty() {
@@ -73,7 +73,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertFalse(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
public void assertIsEmptyWhenPropsIsNotEmpty() {
Properties mockProperties = mock(Properties.class);
@@ -85,7 +85,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertFalse(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
@SuppressWarnings("unchecked")
public void assertIsEmptyWhenGlobalRuleConfigsIsNotEmpty() {
@@ -98,7 +98,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertFalse(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
public void assertIsEmptyWhenSchemaConfigsIsNotEmpty() {
Map<String, DatabaseConfiguration> mockDatabaseConfigs = getMockSchemaConfiguration(false, false);
@@ -109,7 +109,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertFalse(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
public void assertIsEmptyWhenDataSourcesIsNotEmpty() {
Map<String, DatabaseConfiguration> mockDatabaseConfigs = getMockSchemaConfiguration(false, true);
@@ -120,7 +120,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertFalse(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
public void assertIsEmptyWhenRuleConfigurationsIsNotEmpty() {
Map<String, DatabaseConfiguration> mockDatabaseConfigs = getMockSchemaConfiguration(true, false);
@@ -131,7 +131,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertFalse(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
@SuppressWarnings("unchecked")
public void assertIsEmptyWhenOnlyPropsIsEmpty() {
@@ -145,7 +145,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertFalse(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
public void assertIsEmptyWhenOnlyGlobalRuleConfigsIsEmpty() {
Map<String, DatabaseConfiguration> mockDatabaseConfigs = getMockSchemaConfiguration(true, true);
@@ -158,7 +158,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertFalse(contextManagerBuilderParameter.isEmpty());
}
-
+
@Test
@SuppressWarnings("unchecked")
public void assertIsEmptyWhenOnlySchemaConfigsIsEmpty() {
@@ -173,7 +173,7 @@ public final class ContextManagerBuilderParameterTest {
.build();
assertFalse(contextManagerBuilderParameter.isEmpty());
}
-
+
private Map<String, DatabaseConfiguration> getMockSchemaConfiguration(final boolean dataSourcesIsEmpty, final boolean ruleConfigurationsIsEmpty) {
DatabaseConfiguration mockSchemaConfiguration = Mockito.mock(DatabaseConfiguration.class, RETURNS_DEEP_STUBS);
lenient().when(mockSchemaConfiguration.getDataSources().isEmpty()).thenReturn(dataSourcesIsEmpty);
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerTest.java b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerTest.java
index 5d7e29d4f6c..9c0c0a87000 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/ContextManagerTest.java
@@ -121,7 +121,7 @@ public final class ContextManagerTest {
@Test
public void assertAlterSchema() {
- contextManager.alterSchema("foo_schema", Collections.singletonMap("foo_schema", new ShardingSphereSchema(Collections.singletonMap("foo_table",
+ contextManager.alterSchema("foo_schema", Collections.singletonMap("foo_schema", new ShardingSphereSchema(Collections.singletonMap("foo_table",
new TableMetaData("foo_table", Collections.emptyList(), Collections.emptyList(), Collections.emptyList())))));
assertTrue(contextManager.getMetaDataContexts().getMetaDataMap().get("foo_schema").getDefaultSchema().containsTable("foo_table"));
assertTrue(contextManager.getMetaDataContexts().getOptimizerContext().getFederationMetaData().getDatabases().containsKey("foo_schema"));
@@ -194,7 +194,7 @@ public final class ContextManagerTest {
assertThat(actual.getUsername(), is("test"));
}
- @Test
+ @Test
public void assertDropResource() {
when(metaDataContexts.getMetaData("foo_schema").getResource().getDataSources()).thenReturn(new HashMap<>(Collections.singletonMap("foo_ds", new MockedDataSource())));
contextManager.dropResource("foo_schema", Collections.singleton("foo_ds"));
@@ -205,7 +205,7 @@ public final class ContextManagerTest {
public void assertAlterRuleConfiguration() {
ShardingSphereResource resource = mock(ShardingSphereResource.class);
when(resource.getDatabaseType()).thenReturn(new MySQLDatabaseType());
- when(metaDataContexts.getMetaDataMap()).thenReturn(Collections.singletonMap("foo_schema",
+ when(metaDataContexts.getMetaDataMap()).thenReturn(Collections.singletonMap("foo_schema",
new ShardingSphereMetaData("foo_schema", resource, mock(ShardingSphereRuleMetaData.class), Collections.emptyMap())));
when(metaDataContexts.getMetaDataPersistService()).thenReturn(Optional.of(mock(MetaDataPersistService.class, RETURNS_DEEP_STUBS)));
RuleConfiguration ruleConfig = mock(RuleConfiguration.class);
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/node/SchemaMetaDataNodeTest.java b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/node/SchemaMetaDataNodeTest.java
index 2edcb391499..136a0a0e806 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/node/SchemaMetaDataNodeTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/persist/node/SchemaMetaDataNodeTest.java
@@ -56,7 +56,7 @@ public class SchemaMetaDataNodeTest {
public void assertGetMetaDataTablesPath() {
assertThat(SchemaMetaDataNode.getMetaDataTablesPath("sharding_db", "sharding_db"), is("/metadata/sharding_db/sharding_db/tables"));
}
-
+
@Test
public void assertGetDatabaseNameBySchemaPath() {
Optional<String> actualSchemaName = SchemaMetaDataNode.getDatabaseNameBySchemaPath("/metadata/logic_db");
@@ -89,22 +89,22 @@ public class SchemaMetaDataNodeTest {
public void assertGetSchemaVersionPath() {
assertThat(SchemaMetaDataNode.getSchemaVersionPath("logic_db", "0"), is("/metadata/logic_db/logic_db/versions/0"));
}
-
+
@Test
public void assertGetTableMetaDataPath() {
assertThat(SchemaMetaDataNode.getTableMetaDataPath("db", "schema", "table"), is("/metadata/db/schema/tables/table"));
}
-
+
@Test
public void assertGetDatabaseNamePath() {
assertThat(SchemaMetaDataNode.getDatabaseNamePath("db"), is("/metadata/db"));
}
-
+
@Test
public void assertGetMetaDataNodePath() {
assertThat(SchemaMetaDataNode.getMetaDataNodePath(), is("/metadata"));
}
-
+
@Test
public void assertGetMetaDataDataSourcePath() {
assertThat(SchemaMetaDataNode.getMetaDataDataSourcePath(DefaultSchema.LOGIC_NAME, "0"), is("/metadata/logic_db/logic_db/versions/0/dataSources"));
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
index 081a043e6fa..9f1a606b0dc 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterContextManagerCoordinatorTest.java
@@ -198,7 +198,7 @@ public final class ClusterContextManagerCoordinatorTest {
when(metaData.getRuleMetaData().getRules()).thenReturn(Collections.singletonList(statusContainedRule));
DisabledStateChangedEvent event = new DisabledStateChangedEvent(new QualifiedSchema("schema.readwrite_ds.ds_0"), true);
coordinator.renew(event);
- verify(statusContainedRule, times(1)).updateStatus(argThat((ArgumentMatcher<DataSourceNameDisabledEvent>) argumentEvent ->
+ verify(statusContainedRule, times(1)).updateStatus(argThat((ArgumentMatcher<DataSourceNameDisabledEvent>) argumentEvent ->
Objects.equals(event.getQualifiedSchema(), argumentEvent.getQualifiedSchema()) && argumentEvent.isDisabled()));
}
@@ -350,7 +350,7 @@ public final class ClusterContextManagerCoordinatorTest {
assertThat(contextManager.getInstanceContext().getComputeNodeInstances().size(), is(2));
assertThat(((LinkedList<ComputeNodeInstance>) contextManager.getInstanceContext().getComputeNodeInstances()).get(1).getInstanceDefinition(), is(instanceDefinition1));
}
-
+
private Map<String, DataSource> initContextManager() {
Map<String, DataSource> result = getDataSourceMap();
ShardingSphereResource shardingSphereResource = new ShardingSphereResource(result, mock(DataSourcesMetaData.class), mock(CachedDatabaseMetaData.class), mock(DatabaseType.class));
@@ -358,7 +358,7 @@ public final class ClusterContextManagerCoordinatorTest {
contextManager.getMetaDataContexts().getMetaDataMap().put("schema", mockShardingSphereMetaData);
return result;
}
-
+
private Map<String, DataSource> getDataSourceMap() {
Map<String, DataSource> result = new LinkedHashMap<>(3, 1);
result.put("ds_0", getDefaultMockedDataSource());
@@ -366,7 +366,7 @@ public final class ClusterContextManagerCoordinatorTest {
result.put("schema", getDefaultMockedDataSource());
return result;
}
-
+
private Map<String, DataSourceProperties> getVersionChangedDataSourcePropertiesMap() {
Map<String, DataSourceProperties> result = new LinkedHashMap<>(3, 1);
result.put("primary_ds", DataSourcePropertiesCreator.create(getDefaultMockedDataSource()));
@@ -374,15 +374,15 @@ public final class ClusterContextManagerCoordinatorTest {
result.put("ds_1", DataSourcePropertiesCreator.create(getChangeMockedDataSource()));
return result;
}
-
+
private MockedDataSource getDefaultMockedDataSource() {
return new MockedDataSource();
}
-
+
private MockedDataSource getChangeMockedDataSource() {
MockedDataSource result = new MockedDataSource();
result.setMaxPoolSize(5);
result.setUsername("username");
return result;
}
-}
+}
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterPersistRepositoryFactoryTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterPersistRepositoryFactoryTest.java
index facf7bb5925..1991571c189 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterPersistRepositoryFactoryTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/ClusterPersistRepositoryFactoryTest.java
@@ -30,11 +30,11 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public final class ClusterPersistRepositoryFactoryTest {
-
+
static {
ShardingSphereServiceLoader.register(ClusterPersistRepositoryFixture.class);
}
-
+
@Test
public void assertNewInstance() {
ClusterPersistRepositoryConfiguration config = new ClusterPersistRepositoryConfiguration("TEST", "", "", new Properties());
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/lock/DistributeLockContextTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/lock/DistributeLockContextTest.java
index 3e7f952e582..a5a9dd1f430 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/lock/DistributeLockContextTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/lock/DistributeLockContextTest.java
@@ -102,7 +102,7 @@ public final class DistributeLockContextTest {
distributeLockContext.renew(new AckLockReleasedEvent("schema-127.0.0.1@3307"));
assertNotNull(distributeLockContext.getSchemaLock("schema"));
}
-
+
@Test
public void assertRenew() throws IllegalAccessException, NoSuchFieldException {
DistributeLockContext distributeLockContext = new DistributeLockContext(mock(LockRegistryService.class));
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-etcd/src/test/java/org/apache/shardingsphere/mode/repository/cluster/etcd/EtcdRepositoryTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluste [...]
index cd60a7aa133..b20cd3f16ef 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-etcd/src/test/java/org/apache/shardingsphere/mode/repository/cluster/etcd/EtcdRepositoryTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-etcd/src/test/java/org/apache/shardingsphere/mode/repository/cluster/etcd/EtcdRepositoryTest.java
@@ -95,10 +95,10 @@ public final class EtcdRepositoryTest {
@Mock
private CompletableFuture putFuture;
-
+
@Mock
private CompletableFuture lockFuture;
-
+
@Mock
private Lock etcdLock;
@@ -156,7 +156,7 @@ public final class EtcdRepositoryTest {
io.etcd.jetcd.api.KeyValue keyValue2 = io.etcd.jetcd.api.KeyValue.newBuilder()
.setKey(ByteString.copyFromUtf8("/key/key2"))
.setValue(ByteString.copyFromUtf8("value3")).build();
- List<KeyValue> keyValues = Arrays.asList(new KeyValue(keyValue1, ByteSequence.EMPTY), new KeyValue(keyValue2, ByteSequence.EMPTY),
+ List<KeyValue> keyValues = Arrays.asList(new KeyValue(keyValue1, ByteSequence.EMPTY), new KeyValue(keyValue2, ByteSequence.EMPTY),
new KeyValue(keyValue1, ByteSequence.EMPTY));
when(getResponse.getKvs()).thenReturn(keyValues);
List<String> actual = repository.getChildrenKeys("/key");
@@ -301,14 +301,14 @@ public final class EtcdRepositoryTest {
FieldSetter.setField(result, result.getClass().getDeclaredField("events"), events);
return result;
}
-
+
@Test
@SneakyThrows
public void assertTryLock() {
repository.tryLock("test", 5, TimeUnit.SECONDS);
verify(etcdLock).lock(ByteSequence.from("test", StandardCharsets.UTF_8), 123L);
}
-
+
@Test
@SneakyThrows
public void assertReleaseLock() {
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryConfigurationYamlSwapperTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryConfigurationYamlSwapperTest.java
index 4517d9c92c8..7f6868e9f3d 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryConfigurationYamlSwapperTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryConfigurationYamlSwapperTest.java
@@ -28,11 +28,11 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public final class StandalonePersistRepositoryConfigurationYamlSwapperTest {
-
+
public static final String TEST_TYPE = "TEST_TYPE";
-
+
private StandalonePersistRepositoryConfigurationYamlSwapper swapper = new StandalonePersistRepositoryConfigurationYamlSwapper();
-
+
@Test
public void assertSwapToYamlConfiguration() {
Properties testProps = new Properties();
@@ -41,7 +41,7 @@ public final class StandalonePersistRepositoryConfigurationYamlSwapperTest {
assertThat(actual.getProps(), is(testProps));
assertThat(actual.getType(), is(TEST_TYPE));
}
-
+
@Test
public void assertSwapToObject() {
YamlPersistRepositoryConfiguration yamlPersistRepositoryConfiguration = new YamlPersistRepositoryConfiguration();
@@ -52,7 +52,7 @@ public final class StandalonePersistRepositoryConfigurationYamlSwapperTest {
assertThat(actual.getProps(), is(testProps));
assertThat(actual.getType(), is(TEST_TYPE));
}
-
+
@Test
public void assertGetType() {
assertThat(swapper.getType(), is("Standalone"));
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryFactoryTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryFactoryTest.java
index 7d8a4987c6a..6ce9e3779b4 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryFactoryTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryFactoryTest.java
@@ -33,24 +33,24 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
public final class StandalonePersistRepositoryFactoryTest {
-
+
static {
ShardingSphereServiceLoader.register(StandalonePersistRepositoryFixture.class);
}
-
+
@Test
public void assertNewInstanceWithNoConfig() {
StandalonePersistRepository standalonePersistRepository = StandalonePersistRepositoryFactory.newInstance(null);
assertThat(standalonePersistRepository.getType(), is("File"));
}
-
+
@Test
public void assertNewInstanceWithConfig() {
PersistRepositoryConfiguration config = new StandalonePersistRepositoryConfiguration("File", new Properties());
StandalonePersistRepository standalonePersistRepository = StandalonePersistRepositoryFactory.newInstance(config);
assertNotNull(standalonePersistRepository);
}
-
+
@Test(expected = ServiceProviderNotFoundException.class)
public void assertNewInstanceWhenTypeIsNotExist() {
PersistRepositoryConfiguration config = new StandalonePersistRepositoryConfiguration("NOT_EXISTED", new Properties());
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/fixture/StandalonePersistRepositoryFixture.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/fixture/StandalonePersistRepositoryFixture.java
index bccef277548..b7bda3f1bec 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/fixture/StandalonePersistRepositoryFixture.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/fixture/StandalonePersistRepositoryFixture.java
@@ -25,18 +25,18 @@ import java.util.List;
import java.util.Map;
public final class StandalonePersistRepositoryFixture implements StandalonePersistRepository {
-
+
private Map<String, String> persistMap = new HashMap<>();
-
+
@Override
public String get(final String key) {
return persistMap.get(key);
}
-
+
@Override
public List<String> getChildrenKeys(final String key) {
List<String> result = new LinkedList<>();
- for (String each: persistMap.keySet()) {
+ for (String each : persistMap.keySet()) {
if (each.startsWith(key)) {
String child = each.substring(key.length() + 1, each.indexOf('/', key.length() + 1));
if (!result.contains(child)) {
@@ -46,20 +46,20 @@ public final class StandalonePersistRepositoryFixture implements StandalonePersi
}
return result;
}
-
+
@Override
public void persist(final String key, final String value) {
persistMap.put(key, value);
}
-
+
@Override
public void delete(final String key) {
}
-
+
@Override
public void close() {
}
-
+
@Override
public String getType() {
return "File";
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/yaml/PersistRepositoryConfigurationYamlSwapperEngineTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/yaml/PersistRepositoryConfigurationYamlSwapperEngineTest.java
index e69c5e58908..0f82aab9b90 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/yaml/PersistRepositoryConfigurationYamlSwapperEngineTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/yaml/PersistRepositoryConfigurationYamlSwapperEngineTest.java
@@ -30,7 +30,7 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public final class PersistRepositoryConfigurationYamlSwapperEngineTest {
-
+
@Test
public void assertSwapToYamlConfiguration() {
PersistRepositoryConfigurationYamlSwapperEngine persistRepositoryConfigurationYamlSwapperEngine = new PersistRepositoryConfigurationYamlSwapperEngine();
@@ -39,7 +39,7 @@ public final class PersistRepositoryConfigurationYamlSwapperEngineTest {
YamlPersistRepositoryConfiguration yamlPersistRepositoryConfiguration = persistRepositoryConfigurationYamlSwapperEngine.swapToYamlConfiguration(type, standalonePersistRepositoryConfiguration);
assertTrue(yamlPersistRepositoryConfiguration.getType().equalsIgnoreCase("Standalone"));
}
-
+
@Test
public void assertSwapToObject() {
PersistRepositoryConfigurationYamlSwapperEngine persistRepositoryConfigurationYamlSwapperEngine = new PersistRepositoryConfigurationYamlSwapperEngine();
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-repository/shardingsphere-standalone-mode-repository-provider/shardingsphere-standalone-mode-repository-h2/src/test/java/org/apache/shardingsphere/mode/repository/standalone/h2/H2RepositoryTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-repository/shardingsphere-standalone-mode-repository-provider/sha [...]
index 5fc45c982bd..4b3c28ca07f 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-repository/shardingsphere-standalone-mode-repository-provider/shardingsphere-standalone-mode-repository-h2/src/test/java/org/apache/shardingsphere/mode/repository/standalone/h2/H2RepositoryTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-repository/shardingsphere-standalone-mode-repository-provider/shardingsphere-standalone-mode-repository-h2/src/test/java/org/apache/shardingsphere/mode/repository/standalone/h2/H2RepositoryTest.java
@@ -47,7 +47,7 @@ public final class H2RepositoryTest {
public void assertType() {
assertThat(h2Repository.getType(), is("H2"));
}
-
+
@Test
public void assertPersistAndGet() {
h2Repository.persist("/testPath/test1", "test1_content");
@@ -55,7 +55,7 @@ public final class H2RepositoryTest {
h2Repository.persist("/testPath/test1", "modify_content");
assertThat(h2Repository.get("/testPath/test1"), is("modify_content"));
}
-
+
@Test
public void assertPersistAndGetChildrenKeys() {
h2Repository.persist("/testPath/test1", "test1_content");
@@ -64,7 +64,7 @@ public final class H2RepositoryTest {
assertThat(childrenKeys.get(0), is("test1"));
assertThat(childrenKeys.get(1), is("test2"));
}
-
+
@Test
public void assertDelete() {
h2Repository.delete("/testPath");
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/fixture/CallTimeRecordDataSource.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/fixture/CallTimeRecordDataSource.java
index 551b48a76d3..32485101be3 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/fixture/CallTimeRecordDataSource.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/datasource/fixture/CallTimeRecordDataSource.java
@@ -333,7 +333,7 @@ public final class CallTimeRecordDataSource implements DataSource, AutoCloseable
@Override
public void abort(final Executor executor) {
}
-
+
@Override
public void setNetworkTimeout(final Executor executor, final int milliseconds) {
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyDataSourceConfigurationSwapperTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyDataSourceConfigurationSwapperTest.java
index b54fd2a6db1..3a3e2a50d95 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyDataSourceConfigurationSwapperTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/config/yaml/swapper/YamlProxyDataSourceConfigurationSwapperTest.java
@@ -33,7 +33,7 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public final class YamlProxyDataSourceConfigurationSwapperTest {
-
+
@Test
public void assertSwap() throws IOException {
YamlProxyConfiguration yamlProxyConfig = ProxyConfigurationLoader.load("/conf/swap");
@@ -42,7 +42,7 @@ public final class YamlProxyDataSourceConfigurationSwapperTest {
assertConnectionConfig(actualDataSourceConfig);
assertPoolConfig(actualDataSourceConfig);
}
-
+
private void assertConnectionConfig(final DataSourceConfiguration actualDataSourceConfig) {
ConnectionConfiguration actualConnection = actualDataSourceConfig.getConnection();
assertNotNull(actualConnection);
@@ -50,7 +50,7 @@ public final class YamlProxyDataSourceConfigurationSwapperTest {
assertThat(actualConnection.getUsername(), is("sa"));
assertThat(actualConnection.getPassword(), is(""));
}
-
+
private void assertPoolConfig(final DataSourceConfiguration actualDataSourceConfig) {
PoolConfiguration actualPool = actualDataSourceConfig.getPool();
assertNotNull(actualPool);
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/exception/TableModifyInTransactionExceptionTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/exception/TableModifyInTransactionExceptionTest.java
index 86b28b02dc4..72e5db0dc04 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/exception/TableModifyInTransactionExceptionTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/exception/TableModifyInTransactionExceptionTest.java
@@ -32,21 +32,21 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class TableModifyInTransactionExceptionTest {
-
+
@Test
public void assertTableNameWhenSQLStatementContextInstanceOfSQLStatementContextUnImplementsTableAvailable() {
SQLStatementContext sqlStatementContext = mock(SQLStatementContext.class);
TableModifyInTransactionException tableModifyInTransactionException = new TableModifyInTransactionException(sqlStatementContext);
assertThat(tableModifyInTransactionException.getTableName(), is("unknown_table"));
}
-
+
@Test
public void assertTableNameWhenSQLStatementContextInstanceOfSQLStatementContextImplementsTableAvailable() {
SQLStatementContext sqlStatementContext = mock(TestSQLStatementContextInstanceOfTableAvailable.class);
TableModifyInTransactionException tableModifyInTransactionException = new TableModifyInTransactionException(sqlStatementContext);
assertThat(tableModifyInTransactionException.getTableName(), is("unknown_table"));
}
-
+
@Test
public void assertTableNameWhenSQLStatementContextInstanceOfSQLStatementContextImplementsTableAvailableOnEmptyTableList() {
TestSQLStatementContextInstanceOfTableAvailable sqlStatementContext = mock(TestSQLStatementContextInstanceOfTableAvailable.class);
@@ -54,7 +54,7 @@ public class TableModifyInTransactionExceptionTest {
TableModifyInTransactionException tableModifyInTransactionException = new TableModifyInTransactionException(sqlStatementContext);
assertThat(tableModifyInTransactionException.getTableName(), is("unknown_table"));
}
-
+
@Test
public void assertTableNameWhenSQLStatementContextInstanceOfSQLStatementContextImplementsTableAvailableOnAnyTableList() {
TestSQLStatementContextInstanceOfTableAvailable sqlStatementContext = mock(TestSQLStatementContextInstanceOfTableAvailable.class);
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/exception/fixture/TestSQLStatementContextInstanceOfTableAvailable.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/exception/fixture/TestSQLStatementContextInstanceOfTableAvailable.java
index f2297735814..600c00286c0 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/exception/fixture/TestSQLStatementContextInstanceOfTableAvailable.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/exception/fixture/TestSQLStatementContextInstanceOfTableAvailable.java
@@ -30,18 +30,18 @@ import java.util.Collection;
@RequiredArgsConstructor
public final class TestSQLStatementContextInstanceOfTableAvailable implements SQLStatementContext<SQLStatement>, TableAvailable {
-
+
private final SQLStatement sqlStatement;
-
+
private final Collection<SimpleTableSegment> allTables;
-
+
private final TablesContext tablesContext;
-
+
@Override
public SQLStatement getSqlStatement() {
return sqlStatement;
}
-
+
@Override
public TablesContext getTablesContext() {
return tablesContext;
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/data/QueryResponseRowTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/data/QueryResponseRowTest.java
index 4a61aaf335e..e7842514e4e 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/data/QueryResponseRowTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/data/QueryResponseRowTest.java
@@ -32,13 +32,13 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class QueryResponseRowTest {
-
+
@Test
public void assertGetDataWhenQueryResponseCellsOfEmptyList() {
QueryResponseRow queryResponseRow = new QueryResponseRow(Collections.emptyList());
assertThat(queryResponseRow.getData(), is(Collections.emptyList()));
}
-
+
@Test
public void assertGetDataWhenQueryResponseCellsInstanceOfBinaryQueryResponseCell() {
BinaryQueryResponseCell binaryQueryResponseCell1 = mock(BinaryQueryResponseCell.class);
@@ -49,7 +49,7 @@ public final class QueryResponseRowTest {
assertThat(queryResponseRow.getData().size(), is(2));
assertTrue(queryResponseRow.getData().containsAll(Arrays.asList(1, "2")));
}
-
+
@Test
public void assertGetDataWhenQueryResponseCellsInstanceOfTextQueryResponseCell() {
TextQueryResponseCell textQueryResponseCell1 = mock(TextQueryResponseCell.class);
@@ -61,7 +61,7 @@ public final class QueryResponseRowTest {
assertThat(queryResponseRow.getData().iterator().next(), instanceOf(String.class));
assertTrue(queryResponseRow.getData().containsAll(Arrays.asList("column_1", "column_2")));
}
-
+
@Test
public void assertGetDataWhenQueryResponseCellsInstanceOfAllTypeQueryResponseCell() {
BinaryQueryResponseCell binaryQueryResponseCell = mock(BinaryQueryResponseCell.class);
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/header/update/UpdateResponseHeaderTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/header/update/UpdateResponseHeaderTest.java
index be1d0ab3770..6081d62247e 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/header/update/UpdateResponseHeaderTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/response/header/update/UpdateResponseHeaderTest.java
@@ -29,7 +29,7 @@ import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
public final class UpdateResponseHeaderTest {
-
+
@Test
public void assertPropertiesWhenExecuteResultOfEmptyList() {
UpdateResponseHeader updateResponseHeader = new UpdateResponseHeader(mock(SQLStatement.class));
@@ -38,7 +38,7 @@ public final class UpdateResponseHeaderTest {
updateResponseHeader.mergeUpdateCount();
assertThat(updateResponseHeader.getUpdateCount(), is(0L));
}
-
+
@Test
public void assertPropertiesWhenExecuteResultOfNotEmptyList() {
UpdateResponseHeader updateResponseHeader = new UpdateResponseHeader(mock(SQLStatement.class), getExecuteUpdateResults());
@@ -47,7 +47,7 @@ public final class UpdateResponseHeaderTest {
updateResponseHeader.mergeUpdateCount();
assertThat(updateResponseHeader.getUpdateCount(), is(4L));
}
-
+
private Collection<UpdateResult> getExecuteUpdateResults() {
UpdateResult updateResult1 = new UpdateResult(1, 2L);
UpdateResult updateResult2 = new UpdateResult(3, 4L);
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/information/SelectInformationExecutorTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/information/SelectInformationExecutorTest.java
index 37e99539a09..10e0f32fefe 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/information/SelectInformationExecutorTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/information/SelectInformationExecutorTest.java
@@ -77,7 +77,7 @@ public final class SelectInformationExecutorTest {
}
private static final ResultSet RESULT_SET = mock(HikariProxyResultSet.class);
-
+
private final ParserConfiguration parserConfig = new SQLParserRule(new DefaultSQLParserRuleConfigurationBuilder().build()).toParserConfiguration();
@Mock
@@ -88,7 +88,7 @@ public final class SelectInformationExecutorTest {
Field contextManagerField = ProxyContext.getInstance().getClass().getDeclaredField("contextManager");
contextManagerField.setAccessible(true);
ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
- MetaDataContexts metaDataContexts = new MetaDataContexts(mock(MetaDataPersistService.class), new HashMap<>(), mock(ShardingSphereRuleMetaData.class),
+ MetaDataContexts metaDataContexts = new MetaDataContexts(mock(MetaDataPersistService.class), new HashMap<>(), mock(ShardingSphereRuleMetaData.class),
mock(ExecutorEngine.class), mock(OptimizerContext.class), new ConfigurationProperties(new Properties()));
when(contextManager.getMetaDataContexts()).thenReturn(metaDataContexts);
ProxyContext.getInstance().init(contextManager);
@@ -202,7 +202,7 @@ public final class SelectInformationExecutorTest {
selectSchemataExecutor.execute(connectionSession);
assertThat(selectSchemataExecutor.getQueryResultMetaData().getColumnCount(), is(0));
}
-
+
@Test
public void assertSelectSchemaAliasExecute() throws SQLException {
final String sql = "SELECT SCHEMA_NAME AS sn, DEFAULT_CHARACTER_SET_NAME FROM information_schema.SCHEMATA";
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/postgresql/executor/SelectDatabaseExecutorTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/postgresql/executor/SelectDatabaseExecutorTest.java
index 2648cddfe6a..8360ff790a4 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/postgresql/executor/SelectDatabaseExecutorTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/postgresql/executor/SelectDatabaseExecutorTest.java
@@ -67,7 +67,7 @@ import static org.mockito.Mockito.when;
public final class SelectDatabaseExecutorTest {
private static final ResultSet RESULT_SET = mock(HikariProxyResultSet.class);
-
+
private final ParserConfiguration parserConfig = new SQLParserRule(new DefaultSQLParserRuleConfigurationBuilder().build()).toParserConfiguration();
@Before
@@ -75,7 +75,7 @@ public final class SelectDatabaseExecutorTest {
Field contextManagerField = ProxyContext.getInstance().getClass().getDeclaredField("contextManager");
contextManagerField.setAccessible(true);
ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
- MetaDataContexts metaDataContexts = new MetaDataContexts(mock(MetaDataPersistService.class), new HashMap<>(), mock(ShardingSphereRuleMetaData.class),
+ MetaDataContexts metaDataContexts = new MetaDataContexts(mock(MetaDataPersistService.class), new HashMap<>(), mock(ShardingSphereRuleMetaData.class),
mock(ExecutorEngine.class), mock(OptimizerContext.class), new ConfigurationProperties(new Properties()));
when(contextManager.getMetaDataContexts()).thenReturn(metaDataContexts);
ProxyContext.getInstance().init(contextManager);
@@ -126,8 +126,8 @@ public final class SelectDatabaseExecutorTest {
@Test
public void assertSelectSchemataExecute() throws SQLException {
- final String sql = "SELECT d.oid, d.datname AS databasename, d.datacl, d.datistemplate, d.datallowconn, pg_get_userbyid(d.datdba) AS databaseowner,"
- + " d.datcollate, d.datctype, shobj_description(d.oid, 'pg_database') AS description, d.datconnlimit, t.spcname, d.encoding, pg_encoding_to_char(d.encoding) AS encodingname "
+ final String sql = "SELECT d.oid, d.datname AS databasename, d.datacl, d.datistemplate, d.datallowconn, pg_get_userbyid(d.datdba) AS databaseowner,"
+ + " d.datcollate, d.datctype, shobj_description(d.oid, 'pg_database') AS description, d.datconnlimit, t.spcname, d.encoding, pg_encoding_to_char(d.encoding) AS encodingname "
+ "FROM pg_database d LEFT JOIN pg_tablespace t ON d.dattablespace = t.oid;";
final SQLStatement sqlStatement = new ShardingSphereSQLParserEngine("PostgreSQL", parserConfig).parse(sql, false);
Map<String, String> mockResultSetMap = new HashMap<>();
@@ -160,8 +160,8 @@ public final class SelectDatabaseExecutorTest {
@Test
public void assertSelectSchemataWithoutDataSourceExecute1() throws SQLException {
- final String sql = "SELECT d.oid, d.datname AS databasename, d.datacl, d.datistemplate, d.datallowconn, pg_get_userbyid(d.datdba) AS databaseowner, "
- + "d.datcollate, d.datctype, shobj_description(d.oid, 'pg_database') AS description, d.datconnlimit, t.spcname, d.encoding, pg_encoding_to_char(d.encoding) AS encodingname "
+ final String sql = "SELECT d.oid, d.datname AS databasename, d.datacl, d.datistemplate, d.datallowconn, pg_get_userbyid(d.datdba) AS databaseowner, "
+ + "d.datcollate, d.datctype, shobj_description(d.oid, 'pg_database') AS description, d.datconnlimit, t.spcname, d.encoding, pg_encoding_to_char(d.encoding) AS encodingname "
+ "FROM pg_database d LEFT JOIN pg_tablespace t ON d.dattablespace = t.oid;";
final SQLStatement sqlStatement = new ShardingSphereSQLParserEngine("PostgreSQL", parserConfig).parse(sql, false);
Map<String, String> mockResultSetMap = new HashMap<>();
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/AlterInstanceHandlerTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/AlterInstanceHandlerTest.java
index 096394828d4..67826a2034b 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/AlterInstanceHandlerTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/updatable/AlterInstanceHandlerTest.java
@@ -32,7 +32,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class AlterInstanceHandlerTest {
-
+
@Test(expected = UnsupportedOperationException.class)
public void assertUpdateWithNotSupportedKey() throws SQLException {
String instanceId = "instance_id";
@@ -40,7 +40,7 @@ public final class AlterInstanceHandlerTest {
String value = "value_1";
new AlterInstanceHandler().initStatement(getSQLStatement(instanceId, key, value)).execute();
}
-
+
@Test(expected = UnsupportedOperationException.class)
public void assertCheckWithNoPersistenceConfigurationFound() throws SQLException {
ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
@@ -51,7 +51,7 @@ public final class AlterInstanceHandlerTest {
String value = "value_1";
new AlterInstanceHandler().initStatement(getSQLStatement(instanceId, key, value)).execute();
}
-
+
@Test(expected = UnsupportedOperationException.class)
public void assertCheckWithNotExistInstanceId() throws SQLException {
ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
@@ -63,7 +63,7 @@ public final class AlterInstanceHandlerTest {
String value = "value_1";
new AlterInstanceHandler().initStatement(getSQLStatement(instanceId, key, value)).execute();
}
-
+
private AlterInstanceStatement getSQLStatement(final String instanceId, final String key, final String value) {
return new AlterInstanceStatement(instanceId, key, value);
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/transaction/TransactionBackendHandlerFactoryTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/transaction/TransactionBackendHandlerFactoryTest.java
index ed670709133..e7ea7d14c4d 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/transaction/TransactionBackendHandlerFactoryTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/transaction/TransactionBackendHandlerFactoryTest.java
@@ -46,7 +46,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public final class TransactionBackendHandlerFactoryTest {
-
+
@Before
@SneakyThrows(ReflectiveOperationException.class)
public void setTransactionContexts() {
diff --git a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/test/java/org/apache/shardingsphere/proxy/fixture/RuleConfigurationFixtureChecker.java b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/test/java/org/apache/shardingsphere/proxy/fixture/RuleConfigurationFixtureChecker.java
index 5016651ebd8..86663f52411 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/test/java/org/apache/shardingsphere/proxy/fixture/RuleConfigurationFixtureChecker.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/test/java/org/apache/shardingsphere/proxy/fixture/RuleConfigurationFixtureChecker.java
@@ -20,16 +20,16 @@ package org.apache.shardingsphere.proxy.fixture;
import org.apache.shardingsphere.infra.config.checker.RuleConfigurationChecker;
public final class RuleConfigurationFixtureChecker implements RuleConfigurationChecker<RuleConfigurationFixture> {
-
+
@Override
public void check(final String schemaName, final RuleConfigurationFixture config) {
}
-
+
@Override
public int getOrder() {
return -2;
}
-
+
@Override
public Class<RuleConfigurationFixture> getTypeClass() {
return RuleConfigurationFixture.class;
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
index 65fe68db94d..6f013fdf755 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/MySQLFrontendEngineTest.java
@@ -187,7 +187,7 @@ public final class MySQLFrontendEngineTest {
}
return result;
}
-
+
private ShardingSphereRuleMetaData buildGlobalRuleMetaData(final ShardingSphereUser user) {
AuthorityRuleConfiguration authorityRuleConfiguration = new AuthorityRuleConfiguration(Collections.singletonList(user), new ShardingSphereAlgorithmConfiguration("NATIVE", new Properties()));
AuthorityRule rule = new AuthorityRuleBuilder().build(authorityRuleConfiguration, Collections.emptyMap());
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactoryTest.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactoryTest.java
index b8c30fabc77..edc5da51b75 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactoryTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/test/java/org/apache/shardingsphere/proxy/frontend/mysql/err/MySQLErrPacketFactoryTest.java
@@ -54,7 +54,7 @@ public final class MySQLErrPacketFactoryTest {
assertThat(actual.getSqlState(), is("XXX"));
assertThat(actual.getErrorMessage(), is("No reason"));
}
-
+
@Test
public void assertNewInstanceWithSQLExceptionOfNullSQLState() {
MySQLErrPacket actual = MySQLErrPacketFactory.newInstance(new SQLException(new RuntimeException("No reason")));
@@ -63,7 +63,7 @@ public final class MySQLErrPacketFactoryTest {
assertThat(actual.getSqlState(), is("HY000"));
assertThat(actual.getErrorMessage(), endsWith("No reason"));
}
-
+
@Test
public void assertNewInstanceWithSQLExceptionOfNullParam() {
MySQLErrPacket actual = MySQLErrPacketFactory.newInstance(new SQLException(""));
diff --git a/shardingsphere-spi/src/test/java/org/apache/shardingsphere/spi/type/ordered/OrderedSPIRegistryTest.java b/shardingsphere-spi/src/test/java/org/apache/shardingsphere/spi/type/ordered/OrderedSPIRegistryTest.java
index 401bbfca9c1..d6e80e55823 100644
--- a/shardingsphere-spi/src/test/java/org/apache/shardingsphere/spi/type/ordered/OrderedSPIRegistryTest.java
+++ b/shardingsphere-spi/src/test/java/org/apache/shardingsphere/spi/type/ordered/OrderedSPIRegistryTest.java
@@ -65,11 +65,11 @@ public final class OrderedSPIRegistryTest {
assertThat(actual.size(), is(1));
assertThat(actual.get(key), instanceOf(OrderedSPIFixtureImpl.class));
}
-
+
@Test
public void assertGetRegisteredServicesFromCache() {
FixtureCustomInterface key = new FixtureCustomInterfaceImpl();
- assertThat(OrderedSPIRegistry.getRegisteredServices(OrderedSPIFixture.class, Collections.singleton(key)),
+ assertThat(OrderedSPIRegistry.getRegisteredServices(OrderedSPIFixture.class, Collections.singleton(key)),
is(OrderedSPIRegistry.getRegisteredServices(OrderedSPIFixture.class, Collections.singleton(key))));
}
}
diff --git a/shardingsphere-spi/src/test/java/org/apache/shardingsphere/spi/type/required/fixture/multiple/DefaultMultipleRequiredSPIFixtureImpl.java b/shardingsphere-spi/src/test/java/org/apache/shardingsphere/spi/type/required/fixture/multiple/DefaultMultipleRequiredSPIFixtureImpl.java
index 2e3e8659eda..d6063d49e3d 100644
--- a/shardingsphere-spi/src/test/java/org/apache/shardingsphere/spi/type/required/fixture/multiple/DefaultMultipleRequiredSPIFixtureImpl.java
+++ b/shardingsphere-spi/src/test/java/org/apache/shardingsphere/spi/type/required/fixture/multiple/DefaultMultipleRequiredSPIFixtureImpl.java
@@ -24,4 +24,3 @@ public final class DefaultMultipleRequiredSPIFixtureImpl implements MultipleRequ
return true;
}
}
-
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/MySQLXAVisitorTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/MySQLXAVisitorTest.java
index 10651e1a4f2..0ce902b320d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/MySQLXAVisitorTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/MySQLXAVisitorTest.java
@@ -40,9 +40,9 @@ import static org.junit.Assert.assertThat;
@RunWith(Parameterized.class)
@RequiredArgsConstructor
public final class MySQLXAVisitorTest {
-
+
private static Collection<Object[]> testUnits = new LinkedList<>();
-
+
static {
testUnits.add(new Object[]{"xa_start", "XA START 0x6262,b'000',7", "START", "0x6262,b'000',7"});
testUnits.add(new Object[]{"xa_begin", "XA BEGIN 0x6262,b'000',7", "BEGIN", "0x6262,b'000',7"});
@@ -52,20 +52,20 @@ public final class MySQLXAVisitorTest {
testUnits.add(new Object[]{"xa_rollback", "XA ROLLBACK 0x6262,b'000',7", "ROLLBACK", "0x6262,b'000',7"});
testUnits.add(new Object[]{"xa_recover", "XA RECOVER", "RECOVER", null});
}
-
+
private final String caseId;
-
+
private final String inputSql;
-
+
private final String op;
-
+
private final String xid;
-
+
@Parameters(name = "{0}")
public static Collection<Object[]> getTestParameters() {
return testUnits;
}
-
+
@Test
public void assertXA() {
CodePointBuffer buffer = CodePointBuffer.withChars(CharBuffer.wrap(inputSql.toCharArray()));
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/ColumnExtractorParameterizedTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/ColumnExtractorParameterizedTest.java
index 64ad37d9f4b..98bd7bd6ef7 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/ColumnExtractorParameterizedTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/ColumnExtractorParameterizedTest.java
@@ -37,24 +37,24 @@ import static org.junit.Assert.assertThat;
@RunWith(Parameterized.class)
@RequiredArgsConstructor
public final class ColumnExtractorParameterizedTest {
-
+
private static Collection<ExpressionSegment> testUnits = new LinkedList<>();
-
+
private static final ColumnSegment COLUMN_SEGMENT = new ColumnSegment(35, 42, new IdentifierValue("order_item_id"));
-
+
static {
testUnits.add(new BinaryOperationExpression(0, 0, COLUMN_SEGMENT, null, null, null));
testUnits.add(new InExpression(0, 0, COLUMN_SEGMENT, null, false));
testUnits.add(new BetweenExpression(0, 0, COLUMN_SEGMENT, null, null, false));
}
-
+
private final ExpressionSegment expression;
-
+
@Parameterized.Parameters(name = "{0}")
public static Collection<ExpressionSegment> getTestParameters() {
return testUnits;
}
-
+
@Test
public void assertExtract() {
Collection<ColumnSegment> columnSegments = ColumnExtractor.extract(expression);
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/ExpressionExtractUtilTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/ExpressionExtractUtilTest.java
index 7d7bfcddc96..82613773387 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/ExpressionExtractUtilTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/ExpressionExtractUtilTest.java
@@ -37,7 +37,7 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public final class ExpressionExtractUtilTest {
-
+
@Test
public void assertExtractAndPredicates() {
ColumnSegment left = new ColumnSegment(26, 33, new IdentifierValue("order_id"));
@@ -47,7 +47,7 @@ public final class ExpressionExtractUtilTest {
assertThat(actual.size(), is(1));
assertThat(actual.iterator().next().getPredicates().iterator().next(), is(expressionSegment));
}
-
+
@Test
public void assertExtractAndPredicatesAndCondition() {
ColumnSegment columnSegment1 = new ColumnSegment(28, 35, new IdentifierValue("order_id"));
@@ -65,7 +65,7 @@ public final class ExpressionExtractUtilTest {
assertThat(iterator.next(), is(leftExpressionSegment));
assertThat(iterator.next(), is(rightExpressionSegment));
}
-
+
@Test
public void assertExtractAndPredicatesOrCondition() {
ColumnSegment columnSegment1 = new ColumnSegment(28, 33, new IdentifierValue("status"));
@@ -83,7 +83,7 @@ public final class ExpressionExtractUtilTest {
assertThat(andPredicate1.getPredicates().iterator().next(), is(expressionSegment1));
assertThat(andPredicate2.getPredicates().iterator().next(), is(expressionSegment2));
}
-
+
@Test
public void assertExtractAndPredicatesOrAndCondition() {
ColumnSegment statusColumn = new ColumnSegment(0, 0, new IdentifierValue("status"));
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtilTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtilTest.java
index ed9eb1edf55..d3ca8aef387 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtilTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtilTest.java
@@ -64,7 +64,7 @@ public final class SQLUtilTest {
assertThat(SQLUtil.getExactlyValue("\"xxx\""), is("xxx"));
assertThat(SQLUtil.getExactlyValue("'xxx'"), is("xxx"));
}
-
+
@Test
public void assertGetExactlyValueWithReservedCharacters() {
assertThat(SQLUtil.getExactlyValue("`xxx`", "`"), is("`xxx`"));
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtilTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtilTest.java
index 318cf35a0c5..6b56d73339d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtilTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SubqueryExtractUtilTest.java
@@ -46,7 +46,7 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public final class SubqueryExtractUtilTest {
-
+
@Test
public void assertGetSubquerySegmentsInWhere() {
MySQLSelectStatement subquerySelectStatement = new MySQLSelectStatement();
@@ -69,7 +69,7 @@ public final class SubqueryExtractUtilTest {
assertThat(result.size(), is(1));
assertThat(result.iterator().next(), is(right.getSubquery()));
}
-
+
@Test
public void assertGetSubquerySegmentsInProjection() {
ColumnSegment left = new ColumnSegment(41, 48, new IdentifierValue("order_id"));
@@ -85,7 +85,7 @@ public final class SubqueryExtractUtilTest {
assertThat(result.size(), is(1));
assertThat(result.iterator().next(), is(subquerySegment));
}
-
+
@Test
public void assertGetSubquerySegmentsInFrom1() {
MySQLSelectStatement subquery = new MySQLSelectStatement();
@@ -95,17 +95,17 @@ public final class SubqueryExtractUtilTest {
subquery.setFrom(new SimpleTableSegment(new TableNameSegment(45, 51, new IdentifierValue("t_order"))));
subquery.setProjections(new ProjectionsSegment(31, 38));
subquery.getProjections().getProjections().add(new ColumnProjectionSegment(new ColumnSegment(31, 38, new IdentifierValue("order_id"))));
-
+
MySQLSelectStatement selectStatement = new MySQLSelectStatement();
selectStatement.setProjections(new ProjectionsSegment(7, 16));
selectStatement.getProjections().getProjections().add(new ColumnProjectionSegment(new ColumnSegment(7, 16, new IdentifierValue("order_id"))));
selectStatement.setFrom(new SubqueryTableSegment(new SubquerySegment(23, 71, subquery)));
-
+
Collection<SubquerySegment> result = SubqueryExtractUtil.getSubquerySegments(selectStatement);
assertThat(result.size(), is(1));
assertThat(result.iterator().next(), is(((SubqueryTableSegment) selectStatement.getFrom()).getSubquery()));
}
-
+
@Test
public void assertGetSubquerySegmentsInFrom2() {
MySQLSelectStatement subqueryLeftSelectStatement = new MySQLSelectStatement();
@@ -160,7 +160,7 @@ public final class SubqueryExtractUtilTest {
private SubquerySegment createSubquerySegmentForFrom() {
SelectStatement selectStatement = new MySQLSelectStatement();
ExpressionSegment left = new ColumnSegment(0, 0, new IdentifierValue("order_id"));
- selectStatement.setWhere(new WhereSegment(0, 0, new InExpression(0, 0,
+ selectStatement.setWhere(new WhereSegment(0, 0, new InExpression(0, 0,
left, new SubqueryExpressionSegment(new SubquerySegment(0, 0, new MySQLSelectStatement())), false)));
return new SubquerySegment(0, 0, selectStatement);
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/WhereExtractUtilTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/WhereExtractUtilTest.java
index 3c906cb27c3..30337f11eda 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/WhereExtractUtilTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/WhereExtractUtilTest.java
@@ -36,12 +36,12 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public final class WhereExtractUtilTest {
-
+
@Test
public void assertGetJoinWhereSegmentsWithEmptySelectStatement() {
assertTrue(WhereExtractUtil.getJoinWhereSegments(new MySQLSelectStatement()).isEmpty());
}
-
+
@Test
public void assertGetJoinWhereSegments() {
JoinTableSegment tableSegment = new JoinTableSegment();
@@ -55,7 +55,7 @@ public final class WhereExtractUtilTest {
WhereSegment actual = joinWhereSegments.iterator().next();
assertThat(actual.getExpr(), is(tableSegment.getCondition()));
}
-
+
@Test
public void assertGetSubqueryWhereSegmentsFromSubqueryTableSegment() {
MySQLSelectStatement subQuerySelectStatement = new MySQLSelectStatement();
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/value/identifier/IdentifierValueTest.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/value/identifier/IdentifierValueTest.java
index ec605297334..567d450e58d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/value/identifier/IdentifierValueTest.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/value/identifier/IdentifierValueTest.java
@@ -29,13 +29,13 @@ public final class IdentifierValueTest {
String text = "'ms_group_${0..1}'";
assertThat(new IdentifierValue(text).getValue(), is("ms_group_${0..1}"));
}
-
+
@Test
public void assertGetIdentifierValueWithQuote() {
String text = "\"ms_group_${0..1}\"";
assertThat(new IdentifierValue(text).getValue(), is("ms_group_${0..1}"));
}
-
+
@Test
public void assertGetIdentifierValueWithBackQuote() {
String text = "`t_order`";
@@ -47,7 +47,7 @@ public final class IdentifierValueTest {
String text = "ds_${[1,2]}.t_order";
assertThat(new IdentifierValue(text).getValue(), is("ds_${1,2}.t_order"));
}
-
+
@Test
public void assertGetIdentifierValueWithReservedBracket() {
String text = "ds_${[1,2]}.t_order";
diff --git a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/src/test/java/org/apache/shardingsphere/integration/agent/test/common/entity/OrderEntity.java b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/src/test/java/org/apache/shardingsphere/integration/agent/test/common/entity/OrderEntity.java
index 043600d4893..2bda81edd6d 100644
--- a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/src/test/java/org/apache/shardingsphere/integration/agent/test/common/entity/OrderEntity.java
+++ b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/src/test/java/org/apache/shardingsphere/integration/agent/test/common/entity/OrderEntity.java
@@ -25,8 +25,8 @@ import lombok.RequiredArgsConstructor;
public final class OrderEntity {
private final long orderId;
-
+
private final int userId;
-
+
private final String status;
}
diff --git a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/src/test/java/org/apache/shardingsphere/integration/agent/test/common/util/OkHttpUtils.java b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/src/test/java/org/apache/shardingsphere/integration/agent/test/common/util/OkHttpUtils.java
index 9ebfc206ad5..cc1991aca54 100644
--- a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/src/test/java/org/apache/shardingsphere/integration/agent/test/common/util/OkHttpUtils.java
+++ b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-common/src/test/java/org/apache/shardingsphere/integration/agent/test/common/util/OkHttpUtils.java
@@ -67,7 +67,7 @@ public final class OkHttpUtils {
public <T> T get(final String url, final Class<T> clazz) throws IOException {
return GSON.fromJson(get(url), clazz);
}
-
+
/**
* Get response json.
*
diff --git a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/java/org/apache/shardingsphere/integration/agent/test/metrics/MetricsPluginIT.java b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/java/org/apache/shardingsphere/integration/agent/test/metrics/MetricsPluginIT.java
index b4927f5874b..c5f2b088db0 100644
--- a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/java/org/apache/shardingsphere/integration/agent/test/metrics/MetricsPluginIT.java
+++ b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/java/org/apache/shardingsphere/integration/agent/test/metrics/MetricsPluginIT.java
@@ -59,7 +59,7 @@ public final class MetricsPluginIT extends BasePluginIT {
public static final String TRANSACTION_COMMIT = "proxy_transaction_commit_total";
public static final String TRANSACTION_ROLLBACK = "proxy_transaction_rollback_total";
-
+
@Test
public void assertProxyWithAgent() {
super.assertProxyWithAgent();
diff --git a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/src/test/java/org/apache/shardingsphere/integration/agent/test/opentelemetry/OpenTelemetryPluginIT.java b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/src/test/java/org/apache/shardingsphere/integration/agent/test [...]
index 1bfb8bf019b..9c88d846d6f 100644
--- a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/src/test/java/org/apache/shardingsphere/integration/agent/test/opentelemetry/OpenTelemetryPluginIT.java
+++ b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/src/test/java/org/apache/shardingsphere/integration/agent/test/opentelemetry/OpenTelemetryPluginIT.java
@@ -46,7 +46,7 @@ public final class OpenTelemetryPluginIT extends BasePluginIT {
private static final String PARSE_SQL = "/shardingsphere/parsesql/";
private static final String EXECUTE_SQL = "/shardingsphere/executesql/";
-
+
@Test
public void assertProxyWithAgent() {
super.assertProxyWithAgent();
diff --git a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/src/test/java/org/apache/shardingsphere/integration/agent/test/opentelemetry/result/TracingResult.java b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/src/test/java/org/apache/shardingsphere/integration/agent/test/ [...]
index 26414207684..bb937c83f39 100644
--- a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/src/test/java/org/apache/shardingsphere/integration/agent/test/opentelemetry/result/TracingResult.java
+++ b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-opentelemetry/src/test/java/org/apache/shardingsphere/integration/agent/test/opentelemetry/result/TracingResult.java
@@ -23,18 +23,18 @@ import java.util.Map;
@Data
public class TracingResult {
-
+
private String traceId;
-
+
private String id;
-
+
private String name;
-
+
private Long timestamp;
-
+
private Long duration;
-
+
private Map<String, String> localEndpoint;
-
+
private Map<String, String> tags;
}
diff --git a/shardingsphere-test/shardingsphere-integration-scaling-test/shardingsphere-integration-scaling-test-mysql/src/test/java/org/apache/shardingsphere/integration/scaling/test/mysql/env/cases/DataSet.java b/shardingsphere-test/shardingsphere-integration-scaling-test/shardingsphere-integration-scaling-test-mysql/src/test/java/org/apache/shardingsphere/integration/scaling/test/mysql/env/cases/DataSet.java
index 2dff8814407..04f90d09841 100644
--- a/shardingsphere-test/shardingsphere-integration-scaling-test/shardingsphere-integration-scaling-test-mysql/src/test/java/org/apache/shardingsphere/integration/scaling/test/mysql/env/cases/DataSet.java
+++ b/shardingsphere-test/shardingsphere-integration-scaling-test/shardingsphere-integration-scaling-test-mysql/src/test/java/org/apache/shardingsphere/integration/scaling/test/mysql/env/cases/DataSet.java
@@ -34,4 +34,3 @@ public final class DataSet {
@XmlElement(name = "type")
private final List<Type> types = new LinkedList<>();
}
-
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertion.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertion.java
index af4e27e912e..7196653ce95 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertion.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/cases/assertion/IntegrationTestCaseAssertion.java
@@ -52,7 +52,7 @@ public final class IntegrationTestCaseAssertion {
@XmlElement(name = "initial-sql")
private IntegrationTestCaseAssertionSQL initialSQL;
-
+
@XmlElement(name = "destroy-sql")
private IntegrationTestCaseAssertionSQL destroySQL;
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereProxyContainer.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereProxyContainer.java
index 26c1beaa8ee..0673d438962 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereProxyContainer.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereProxyContainer.java
@@ -107,7 +107,7 @@ public final class ShardingSphereProxyContainer extends DockerITContainer implem
private static class JDBCConnectionWaitStrategy extends AbstractWaitStrategy {
private final Callable<Connection> connectionSupplier;
-
+
@Override
protected void waitUntilReady() {
Unreliables.retryUntilSuccess((int) startupTimeout.getSeconds(), TimeUnit.SECONDS,
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/runner/parallel/impl/CaseParallelRunnerExecutor.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/runner/parallel/impl/CaseParallelRunnerExecutor.java
index 76f13a7caa1..259d4699e15 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/runner/parallel/impl/CaseParallelRunnerExecutor.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/runner/parallel/impl/CaseParallelRunnerExecutor.java
@@ -30,7 +30,7 @@ import java.util.concurrent.Future;
* Parallel runner executor with case.
*/
public final class CaseParallelRunnerExecutor implements ParallelRunnerExecutor {
-
+
private final ExecutorServiceManager executorServiceManager = new ExecutorServiceManager(Runtime.getRuntime().availableProcessors() * 2 - 1);
private final Collection<Future<?>> taskFeatures = new LinkedList<>();
diff --git a/shardingsphere-test/shardingsphere-parser-test/src/test/java/org/apache/shardingsphere/test/sql/parser/parameterized/DistSQLParserParameterizedTest.java b/shardingsphere-test/shardingsphere-parser-test/src/test/java/org/apache/shardingsphere/test/sql/parser/parameterized/DistSQLParserParameterizedTest.java
index 58ec9fd39f5..90bfa3cbfb7 100644
--- a/shardingsphere-test/shardingsphere-parser-test/src/test/java/org/apache/shardingsphere/test/sql/parser/parameterized/DistSQLParserParameterizedTest.java
+++ b/shardingsphere-test/shardingsphere-parser-test/src/test/java/org/apache/shardingsphere/test/sql/parser/parameterized/DistSQLParserParameterizedTest.java
@@ -47,7 +47,7 @@ public final class DistSQLParserParameterizedTest {
public DistSQLParserParameterizedTest(final String sqlCaseId) {
this.sqlCaseId = sqlCaseId;
}
-
+
@Parameters(name = "{0}")
public static Collection<Object[]> getTestParameters() {
return DIST_SQL_CASES_LOADER.getTestParameters(null);
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/execute/ExecuteEngineTest.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/execute/ExecuteEngineTest.java
index 91e956dd7bd..7307468f7e0 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/execute/ExecuteEngineTest.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/execute/ExecuteEngineTest.java
@@ -60,12 +60,12 @@ public final class ExecuteEngineTest {
return new ExecuteCallback() {
@Override
public void onSuccess() {
-
+
}
@Override
public void onFailure(final Throwable throwable) {
-
+
}
};
}
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/yaml/JobProgressYamlSwapperTest.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/yaml/JobProgressYamlSwapperTest.java
index 21196685b8b..7849735317d 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/yaml/JobProgressYamlSwapperTest.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/yaml/JobProgressYamlSwapperTest.java
@@ -30,13 +30,13 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNull;
public final class JobProgressYamlSwapperTest {
-
+
private static final JobProgressYamlSwapper JOB_PROGRESS_YAML_SWAPPER = new JobProgressYamlSwapper();
-
+
private JobProgress getJobProgress(final String data) {
return JOB_PROGRESS_YAML_SWAPPER.swapToObject(YamlEngine.unmarshal(data, YamlJobProgress.class));
}
-
+
@Test
public void assertFullSwapToYaml() {
JobProgress jobProgress = getJobProgress(ConfigurationFileUtil.readFile("job-progress.yaml"));
@@ -52,14 +52,14 @@ public final class JobProgressYamlSwapperTest {
assertTrue(actual.getIncremental().containsKey("ds0"));
assertNull(actual.getIncremental().get("position"));
}
-
+
@Test
public void assertNullIncremental() {
JobProgress jobProgress = getJobProgress(ConfigurationFileUtil.readFile("job-progress-no-finished.yaml"));
YamlJobProgress actual = JOB_PROGRESS_YAML_SWAPPER.swapToYaml(jobProgress);
assertTrue(actual.getIncremental().isEmpty());
}
-
+
@Test
public void assertNullInventory() {
JobProgress jobProgress = getJobProgress(ConfigurationFileUtil.readFile("job-progress-no-inventory.yaml"));
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/lock/PipelineSimpleLockTest.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/lock/PipelineSimpleLockTest.java
index 5db74e3d4c2..05c73887470 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/lock/PipelineSimpleLockTest.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/lock/PipelineSimpleLockTest.java
@@ -48,5 +48,5 @@ public final class PipelineSimpleLockTest {
assertTrue(locked);
pipelineSimpleLock.releaseLock(lockName);
}
-
+
}
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/metadata/model/PipelineTableMetaDataTest.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/metadata/model/PipelineTableMetaDataTest.java
index 23049f6dbd6..bc76828ece1 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/metadata/model/PipelineTableMetaDataTest.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/metadata/model/PipelineTableMetaDataTest.java
@@ -30,14 +30,14 @@ import java.sql.Types;
import java.util.Collections;
public final class PipelineTableMetaDataTest {
-
+
private PipelineTableMetaData pipelineTableMetaData;
-
+
@Before
public void setUp() {
pipelineTableMetaData = new PipelineTableMetaData("test_data", Collections.singletonMap("test", new PipelineColumnMetaData(1, "test", Types.INTEGER, "INTEGER", true)));
}
-
+
@Test
public void assertGetColumnMetaDataGivenColumnIndex() {
PipelineColumnMetaData actual = pipelineTableMetaData.getColumnMetaData(0);
@@ -46,7 +46,7 @@ public final class PipelineTableMetaDataTest {
assertThat(actual.getDataType(), is(Types.INTEGER));
assertTrue(actual.isPrimaryKey());
}
-
+
@Test
public void assertGetColumnMetaDataGivenColumnName() {
PipelineColumnMetaData actual = pipelineTableMetaData.getColumnMetaData("test");
@@ -56,7 +56,7 @@ public final class PipelineTableMetaDataTest {
assertThat(actual.getDataType(), is(Types.INTEGER));
assertTrue(actual.isPrimaryKey());
}
-
+
@Test
public void assertIsPrimaryKey() {
assertTrue(pipelineTableMetaData.isPrimaryKey(0));
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/record/RecordUtilTest.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/record/RecordUtilTest.java
index 25378c38f56..bf8e69e0771 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/record/RecordUtilTest.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/record/RecordUtilTest.java
@@ -31,7 +31,7 @@ import static org.hamcrest.CoreMatchers.hasItems;
import static org.junit.Assert.assertThat;
public final class RecordUtilTest {
-
+
@Test
public void assertExtractPrimaryColumns() {
DataRecord dataRecord = mockDataRecord("t2");
@@ -39,7 +39,7 @@ public final class RecordUtilTest {
assertThat(actual.size(), is(2));
assertThat(Arrays.asList("sc", "id"), hasItems(actual.iterator().next().getName()));
}
-
+
@Test
public void assertExtractConditionalColumns() {
DataRecord dataRecord = mockDataRecord("t2");
@@ -47,7 +47,7 @@ public final class RecordUtilTest {
assertThat(actual.size(), is(3));
assertThat(Arrays.asList("sc", "id", "c1"), hasItems(actual.iterator().next().getName()));
}
-
+
@Test
public void assertExtractUpdatedColumns() {
DataRecord dataRecord = mockDataRecord("t2");
@@ -55,7 +55,7 @@ public final class RecordUtilTest {
assertThat(actual.size(), is(3));
assertThat(Arrays.asList("c2", "c3", "c1"), hasItems(actual.iterator().next().getName()));
}
-
+
private DataRecord mockDataRecord(final String tableName) {
DataRecord result = new DataRecord(new PlaceholderPosition(), 4);
result.setTableName(tableName);
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/util/ConfigurationFileUtil.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/util/ConfigurationFileUtil.java
index a47dee124f3..ea5de3d5591 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/util/ConfigurationFileUtil.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/util/ConfigurationFileUtil.java
@@ -46,7 +46,7 @@ public final class ConfigurationFileUtil {
/**
* Read file and ignore comments.
- *
+ *
* @param fileName file name
* @return file content without comments
*/
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/spi/DefaultSourceWritingStopAlgorithmTest.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/spi/DefaultSourceWritingStopAlgorithmTest.java
index 78ce0666512..2eabc06a7e7 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/spi/DefaultSourceWritingStopAlgorithmTest.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/spi/DefaultSourceWritingStopAlgorithmTest.java
@@ -22,38 +22,38 @@ import org.junit.Before;
import org.junit.Test;
public final class DefaultSourceWritingStopAlgorithmTest {
-
+
private final DefaultSourceWritingStopAlgorithm defaultSourceWritingStopAlgorithm = new DefaultSourceWritingStopAlgorithm();
-
+
private final String lockName = "lock1";
-
+
private final String jobId = "jobId1";
-
+
@Before
public void setup() {
PipelineContextUtil.mockModeConfigAndContextManager();
}
-
+
@Test
public void assertSuccessLockReleaseLock() {
defaultSourceWritingStopAlgorithm.lock(lockName, jobId);
defaultSourceWritingStopAlgorithm.releaseLock(lockName, jobId);
}
-
+
@Test
public void assertSuccessLockTwiceReleaseLock() {
defaultSourceWritingStopAlgorithm.lock(lockName, jobId);
defaultSourceWritingStopAlgorithm.lock(lockName, jobId);
defaultSourceWritingStopAlgorithm.releaseLock(lockName, jobId);
}
-
+
@Test
public void assertSuccessLockReleaseLockTwice() {
defaultSourceWritingStopAlgorithm.lock(lockName, jobId);
defaultSourceWritingStopAlgorithm.releaseLock(lockName, jobId);
defaultSourceWritingStopAlgorithm.releaseLock(lockName, jobId);
}
-
+
@Test
public void assertSuccessReleaseNullLock() {
defaultSourceWritingStopAlgorithm.releaseLock(lockName, jobId);
diff --git a/shardingsphere-test/shardingsphere-rewrite-test/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameterized/scenario/ShardingSQLRewriterParameterizedTest.java b/shardingsphere-test/shardingsphere-rewrite-test/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameterized/scenario/ShardingSQLRewriterParameterizedTest.java
index 774c261cb59..c9d67732af9 100644
--- a/shardingsphere-test/shardingsphere-rewrite-test/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameterized/scenario/ShardingSQLRewriterParameterizedTest.java
+++ b/shardingsphere-test/shardingsphere-rewrite-test/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameterized/scenario/ShardingSQLRewriterParameterizedTest.java
@@ -54,7 +54,7 @@ public final class ShardingSQLRewriterParameterizedTest extends AbstractSQLRewri
private static final String CASE_PATH = "scenario/sharding/case";
- public ShardingSQLRewriterParameterizedTest(final String type, final String name, final String fileName,
+ public ShardingSQLRewriterParameterizedTest(final String type, final String name, final String fileName,
final String databaseType, final SQLRewriteEngineTestParameters testParameters) {
super(testParameters);
}
@@ -63,14 +63,14 @@ public final class ShardingSQLRewriterParameterizedTest extends AbstractSQLRewri
public static Collection<Object[]> loadTestParameters() {
return SQLRewriteEngineTestParametersBuilder.loadTestParameters(CASE_PATH.toUpperCase(), CASE_PATH, ShardingSQLRewriterParameterizedTest.class);
}
-
+
@Override
protected YamlRootConfiguration createRootConfiguration() throws IOException {
URL url = ShardingSQLRewriterParameterizedTest.class.getClassLoader().getResource(getTestParameters().getRuleFile());
Preconditions.checkNotNull(url, "Cannot found rewrite rule yaml configuration.");
return YamlEngine.unmarshal(new File(url.getFile()), YamlRootConfiguration.class);
}
-
+
@Override
protected void mockRules(final Collection<ShardingSphereRule> rules) {
Optional<SingleTableRule> singleTableRule = rules.stream().filter(each -> each instanceof SingleTableRule).map(each -> (SingleTableRule) each).findFirst();