diff --git a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/natived/NativeStorageContainer.java b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/natived/NativeStorageContainer.java index 50aa0e5611323..f65c0e12d2140 100644 --- a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/natived/NativeStorageContainer.java +++ b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/natived/NativeStorageContainer.java @@ -92,8 +92,13 @@ private Map createDataSourceMap(final Type type) { private Map getDataSourceMap(final Collection databaseNames) { DataSourceEnvironment dataSourceEnvironment = DatabaseTypedSPILoader.getService(DataSourceEnvironment.class, databaseType); - return databaseNames.stream().collect(Collectors.toMap(each -> each, each -> StorageContainerUtils.generateDataSource( - dataSourceEnvironment.getURL(env.getNativeStorageHost(), env.getNativeStoragePort(), each), env.getNativeStorageUsername(), env.getNativeStoragePassword(), 2))); + Map result = new HashMap<>(databaseNames.size(), 1F); + for (String each : databaseNames) { + DataSource dataSource = StorageContainerUtils.generateDataSource( + dataSourceEnvironment.getURL(env.getNativeStorageHost(), env.getNativeStoragePort(), each), env.getNativeStorageUsername(), env.getNativeStoragePassword(), 2); + result.put(each, dataSource); + } + return result; } /** diff --git a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/util/DatabaseVersionParser.java b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/util/DatabaseVersionParser.java deleted file mode 100644 index 6c1ce6dd9b039..0000000000000 --- a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/util/DatabaseVersionParser.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.shardingsphere.test.e2e.env.container.atomic.util; - -import com.google.common.base.Strings; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * Database version parser. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class DatabaseVersionParser { - - /** - * parse major database version. - * - * @param storageContainerImage storage container image - * @return major version - */ - public static String parseMajorVersion(final String storageContainerImage) { - return Strings.isNullOrEmpty(storageContainerImage) ? "" : storageContainerImage.substring(storageContainerImage.indexOf(':') + 1, storageContainerImage.indexOf('.')); - } -}