/*
 * 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.infra.config.datasource.pool.creator;

import com.zaxxer.hikari.HikariDataSource;
import org.apache.shardingsphere.infra.config.datasource.pool.creator.impl.DefaultDataSourcePoolCreator;
import org.apache.shardingsphere.infra.config.datasource.pool.creator.impl.HikariDataSourcePoolCreator;
import org.h2.jdbcx.JdbcDataSource;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

public final class DataSourcePoolCreatorFactoryTest {
    
    @Test
    public void assertGetInstanceWhenDataSourcePoolCreatorExisted() {
        assertTrue(DataSourcePoolCreatorFactory.getInstance(HikariDataSource.class.getName()) instanceof HikariDataSourcePoolCreator);
    }
    
    @Test
    public void assertGetInstanceWhenDataSourcePoolCreatorNotExisted() {
        assertTrue(DataSourcePoolCreatorFactory.getInstance(JdbcDataSource.class.getName()) instanceof DefaultDataSourcePoolCreator);
    }
}

@@ -1136,56 +1136,72 @@
 org.
-h2.jdbcx.JdbcDataSource;%0Aimport org.junit.Test;%0A
+junit.Test;%0A%0Aimport static org.hamcrest.CoreMatchers.instanceOf;
 %0Aimp
@@ -1235,19 +1235,19 @@
 .assertT
-rue
+hat
 ;%0A%0Apubli
@@ -1387,35 +1387,35 @@
 %0A        assertT
-rue
+hat
 (DataSourcePoolC
@@ -1465,32 +1465,33 @@
 class.getName())
+,
  instanceof Hika
@@ -1483,19 +1483,19 @@
 instance
-of 
+Of(
 HikariDa
@@ -1505,32 +1505,39 @@
 ourcePoolCreator
+.class)
 );%0A    %7D%0A    %0A  
@@ -1636,11 +1636,11 @@
 ertT
-rue
+hat
 (Dat
@@ -1681,39 +1681,35 @@
 nce(
-JdbcDataSource.class.getName())
+%22NOT_EXISTED_DATA_SOURCE%22),
  ins
@@ -1713,19 +1713,19 @@
 instance
-of 
+Of(
 DefaultD
@@ -1744,16 +1744,23 @@
 lCreator
+.class)
 );%0A    %7D

Refactor DataSourcePoolCreatorFactoryTest (#14154)