/*
 * 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.datasource.pool.metadata;

import com.zaxxer.hikari.HikariDataSource;
import org.apache.shardingsphere.infra.datasource.pool.metadata.impl.DefaultDataSourcePoolMetaData;
import org.apache.shardingsphere.infra.datasource.pool.metadata.impl.HikariDataSourcePoolMetaData;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;

public final class DataSourcePoolMetaDataFactoryTest {
    
    @Test
    public void assertDefaultInstance() {
        DataSourcePoolMetaData defaultDataSourcePoolMetaData = DataSourcePoolMetaDataFactory.newInstance("");
        assertThat(defaultDataSourcePoolMetaData, instanceOf(DefaultDataSourcePoolMetaData.class));
    }
    
    @Test
    public void assertHikariInstance() {
        DataSourcePoolMetaData hikariDataSourcePoolMetaData = DataSourcePoolMetaDataFactory.newInstance(HikariDataSource.class.getCanonicalName());
        assertThat(hikariDataSourcePoolMetaData, instanceOf(HikariDataSourcePoolMetaData.class));
    }
}

@@ -1321,23 +1321,19 @@
 sert
-Default
+New
 Instance
 () %7B
@@ -1320,32 +1320,42 @@
 ssertNewInstance
+ForDefault
 () %7B%0A        Dat
@@ -1355,158 +1355,64 @@
     
-DataSourcePoolMetaData defaultDataSourcePoolMetaData = DataSourcePoolMetaDataFactory.newInstance(%22%22);%0A        assertThat(defaultDataSourcePoolMetaData
+assertThat(DataSourcePoolMetaDataFactory.newInstance(%22%22)
 , in
@@ -1506,22 +1506,19 @@
 sert
-Hikari
+New
 Instance
 () %7B
@@ -1513,16 +1513,25 @@
 Instance
+ForHikari
 () %7B%0A   
@@ -1539,62 +1539,19 @@
     
-DataSourcePoolMetaData hikariDataSourcePoolMetaData = 
+assertThat(
 Data
@@ -1634,57 +1634,8 @@
 e())
-;%0A        assertThat(hikariDataSourcePoolMetaData
 , in

Revise DataSourcePoolMetaDataFactoryTest (#15002)