Move tests into FailableFunctionsTest

This commit is contained in:
Steve 2022-06-07 10:05:13 +01:00
parent a6e18d9465
commit 3e66c1de17
No known key found for this signature in database
GPG Key ID: 51258E02D54F3259
19 changed files with 104 additions and 606 deletions

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNull;
/**
* Tests {@link FailableDoubleFunction}.
*/
public class FailableDoubleFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableDoubleFunction<Object, Throwable> func = FailableDoubleFunction.nop();
assertNull(func.apply(Double.MAX_VALUE), "Expect NOP to return null");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableDoubleToIntFunction}.
*/
public class FailableDoubleToIntFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableDoubleToIntFunction<Throwable> func = FailableDoubleToIntFunction.nop();
assertEquals(0, func.applyAsInt(Double.MAX_VALUE), "Expect NOP to return default value of 0");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableDoubleToLongFunction}.
*/
public class FailableDoubleToLongFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableDoubleToLongFunction<Throwable> func = FailableDoubleToLongFunction.nop();
assertEquals(0, func.applyAsLong(Double.MAX_VALUE), "Expect NOP to return default value of 0");
}
}

View File

@ -2563,4 +2563,108 @@ public class FailableFunctionsTest {
assertTrue(closeable.isClosed());
}
@Test
public void testFailableDoubleToIntFunctionNop() throws Throwable {
assertEquals(0, FailableDoubleToIntFunction.nop().applyAsInt(Double.MAX_VALUE), "Expect NOP to return 0");
}
@Test
public void testFailableDoubleToLongFunctionNop() throws Throwable {
assertEquals(0, FailableDoubleToLongFunction.nop().applyAsLong(Double.MAX_VALUE), "Expect NOP to return 0");
}
@Test
public void testFailableIntToDoubleFunctionNop() throws Throwable {
assertEquals(0, FailableIntToDoubleFunction.nop().applyAsDouble(Integer.MAX_VALUE), "Expect NOP to return 0");
}
@Test
public void testFailableIntToLongFunctionNop() throws Throwable {
assertEquals(0, FailableIntToLongFunction.nop().applyAsLong(Integer.MAX_VALUE), "Expect NOP to return 0");
}
@Test
public void testFailableLongToDoubleFunctionNop() throws Throwable {
assertEquals(0, FailableLongToDoubleFunction.nop().applyAsDouble(Long.MAX_VALUE), "Expect NOP to return 0");
}
@Test
public void testFailableLongToIntFunctionNop() throws Throwable {
assertEquals(0, FailableLongToIntFunction.nop().applyAsInt(Long.MAX_VALUE), "Expect NOP to return 0");
}
@Test
public void testFailableToIntFunctionNop() throws Throwable {
assertEquals(0, FailableToIntFunction.nop().applyAsInt("Foo"), "Expect NOP to return 0");
}
@Test
public void testFailableToIntBiFunctionNop() throws Throwable {
assertEquals(0, FailableToIntBiFunction.nop().applyAsInt("Foo", "Bar"), "Expect NOP to return 0");
}
@Test
public void testFailableToLongFunctionNop() throws Throwable {
assertEquals(0, FailableToLongFunction.nop().applyAsLong("Foo"), "Expect NOP to return 0");
}
@Test
public void testFailableToLongBiFunctionNop() throws Throwable {
assertEquals(0, FailableToLongBiFunction.nop().applyAsLong("Foo", "Bar"), "Expect NOP to return 0");
}
@Test
public void testFailableToDoubleFunctionNop() throws Throwable {
assertEquals(0, FailableToDoubleFunction.nop().applyAsDouble("Foo"), "Expect NOP to return 0");
}
@Test
public void testFailableToDoubleBiFunctionNop() throws Throwable {
assertEquals(0, FailableToDoubleBiFunction.nop().applyAsDouble("Foo", "Bar"), "Expect NOP to return 0");
}
@Test
public void testFailableBiFunctionNop() throws Throwable {
assertNull(FailableBiFunction.nop().apply("Foo", "Bar"), "Expect NOP to return null");
}
@Test
public void testFailableDoubleFunctionNop() throws Throwable {
assertNull(FailableDoubleFunction.nop().apply(Double.MAX_VALUE), "Expect NOP to return null");
}
@Test
public void testFailableIntFunctionNop() throws Throwable {
assertNull(FailableIntFunction.nop().apply(Integer.MAX_VALUE), "Expect NOP to return null");
}
@Test
public void testFailableLongFunctionNop() throws Throwable {
assertNull(FailableLongFunction.nop().apply(Long.MAX_VALUE), "Expect NOP to return null");
}
@Test
public void testFailableConsumerNop() throws Throwable {
// Expect nothing thrown
FailableConsumer.nop().accept("Foo");
}
@Test
public void testFailableObjDoubleConsumerNop() throws Throwable {
// Expect nothing thrown
FailableObjDoubleConsumer.nop().accept("Foo", Double.MAX_VALUE);
}
@Test
public void testFailableObjIntConsumerNop() throws Throwable {
// Expect nothing thrown
FailableObjIntConsumer.nop().accept("Foo", Integer.MAX_VALUE);
}
@Test
public void testFailableObjLongConsumerNop() throws Throwable {
// Expect nothing thrown
FailableObjLongConsumer.nop().accept("Foo", Long.MAX_VALUE);
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNull;
/**
* Tests {@link FailableIntFunction}.
*/
public class FailableIntFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableIntFunction<Object, Throwable> func = FailableIntFunction.nop();
assertNull(func.apply(Integer.MAX_VALUE), "Expect NOP to return null");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableIntToDoubleFunction}.
*/
public class FailableIntToDoubleFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableIntToDoubleFunction<Throwable> func = FailableIntToDoubleFunction.nop();
assertEquals(0, func.applyAsDouble(Integer.MAX_VALUE), "Expect NOP to return 0");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableIntToLongFunction}.
*/
public class FailableIntToLongFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableIntToLongFunction<Throwable> func = FailableIntToLongFunction.nop();
assertEquals(0, func.applyAsLong(Integer.MAX_VALUE), "Expect NOP to return 0");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertNull;
/**
* Tests {@link FailableLongFunction}.
*/
public class FailableLongFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableLongFunction<Object, Throwable> func = FailableLongFunction.nop();
assertNull(func.apply(Long.MAX_VALUE), "Expect NOP to return null");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableLongToDoubleFunction}.
*/
public class FailableLongToDoubleFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableLongToDoubleFunction<Throwable> func = FailableLongToDoubleFunction.nop();
assertEquals(0, func.applyAsDouble(Long.MAX_VALUE), "Expect NOP to return 0");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableLongToIntFunction}.
*/
public class FailableLongToIntFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableLongToIntFunction<Throwable> func = FailableLongToIntFunction.nop();
assertEquals(0, func.applyAsInt(Long.MAX_VALUE), "Expect NOP to return 0");
}
}

View File

@ -1,37 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.fail;
/**
* Tests {@link FailableObjDoubleConsumer}.
*/
public class FailableObjDoubleConsumerTest {
@Test
public void testNop() {
final FailableObjDoubleConsumer<Object, Throwable> func = FailableObjDoubleConsumer.nop();
try {
func.accept("FOO", Double.MAX_VALUE);
} catch (final Throwable e) {
fail("Accepting NOP must not throw an exception");
}
}
}

View File

@ -1,37 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.fail;
/**
* Tests {@link FailableObjIntConsumer}.
*/
public class FailableObjIntConsumerTest {
@Test
public void testNop() {
final FailableObjIntConsumer<Object, Throwable> func = FailableObjIntConsumer.nop();
try {
func.accept("FOO", Integer.MAX_VALUE);
} catch (final Throwable e) {
fail("Accepting NOP must not throw an exception");
}
}
}

View File

@ -1,37 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.fail;
/**
* Tests {@link FailableObjLongConsumer}.
*/
public class FailableObjLongConsumerTest {
@Test
public void testNop() {
final FailableObjLongConsumer<Object, Throwable> func = FailableObjLongConsumer.nop();
try {
func.accept("FOO", Long.MAX_VALUE);
} catch (final Throwable e) {
fail("Accepting NOP must not throw an exception");
}
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableToDoubleBiFunction}.
*/
public class FailableToDoubleBiFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableToDoubleBiFunction<Object, Object, Throwable> func = FailableToDoubleBiFunction.nop();
assertEquals(0, func.applyAsDouble("FOO", "BAR"), "Expect NOP to return 0");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableToDoubleFunction}.
*/
public class FailableToDoubleFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableToDoubleFunction<Object, Throwable> func = FailableToDoubleFunction.nop();
assertEquals(0, func.applyAsDouble("FOO"), "Expect NOP to return 0");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableToIntBiFunction}.
*/
public class FailableToIntBiFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableToIntBiFunction<Object, Object, Throwable> func = FailableToIntBiFunction.nop();
assertEquals(0, func.applyAsInt("FOO", "BAR"), "Expect NOP to return 0");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableToIntFunction}.
*/
public class FailableToIntFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableToIntFunction<Object, Throwable> func = FailableToIntFunction.nop();
assertEquals(0, func.applyAsInt("FOO"), "Expect NOP to return 0");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableToLongBiFunction}.
*/
public class FailableToLongBiFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableToLongBiFunction<Object, Object, Throwable> func = FailableToLongBiFunction.nop();
assertEquals(0, func.applyAsLong("FOO", "BAR"), "Expect NOP to return 0");
}
}

View File

@ -1,33 +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.commons.lang3.function;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Tests {@link FailableToLongFunction}.
*/
public class FailableToLongFunctionTest {
@Test
public void testNop() throws Throwable {
final FailableToLongFunction<Object, Throwable> func = FailableToLongFunction.nop();
assertEquals(0, func.applyAsLong("Foo"), "Expect NOP to return 0");
}
}