/*
 * Licensed 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.jdbi.v3.core.internal.exceptions;

import java.sql.SQLException;
import java.util.function.Function;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

public class UncheckedTest {
    @Test
    public void hidesThrowsClause() {
        CheckedFunction<String, Object> throwing = UncheckedTest::failToGet;

        assertThatThrownBy(() -> throwing.apply(""))
            .describedAs("throws a checked exception")
            .isInstanceOf(SQLException.class);

        Function<String, Object> muted = Unchecked.function(throwing);

        assertThat(muted)
            .describedAs("does not declare a checked exception")
            .isInstanceOf(Function.class);

        assertThatThrownBy(() -> muted.apply(""))
            .describedAs("still throws a checked exception")
            .isInstanceOf(SQLException.class);
    }

    private static Object failToGet(String key) throws SQLException {
        throw new SQLException();
    }
}

@@ -654,24 +654,24 @@
 unction.
-Function
+Supplier
 ;%0Aimport
@@ -905,39 +905,29 @@
  Checked
-Function%3CString, Object
+Supplier%3CVoid
 %3E throwi
@@ -989,22 +989,16 @@
 nBy(
-() -%3E 
 throwing
 .app
@@ -993,26 +993,21 @@
 throwing
-.apply(%22%22)
+::get
 )%0A      
@@ -1115,31 +1115,21 @@
     
-Function%3CString, Object
+Supplier%3CVoid
 %3E mu
@@ -1144,24 +1144,24 @@
 checked.
-function
+supplier
 (throwin
@@ -1286,16 +1286,16 @@
 eOf(
-Function
+Supplier
 .cla
@@ -1331,29 +1331,18 @@
 nBy(
-() -%3E muted.apply(%22%22)
+muted::get
 )%0A  
@@ -1477,14 +1477,12 @@
 tic 
-Object
+Void
  fai
@@ -1492,18 +1492,8 @@
 Get(
-String key
 ) th

simplify test after new additions