1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.lang3.function;
19
20 import static org.junit.jupiter.api.Assertions.assertEquals;
21 import static org.junit.jupiter.api.Assertions.assertFalse;
22
23 import java.lang.reflect.Method;
24 import java.util.function.Supplier;
25
26 import org.junit.jupiter.api.Test;
27
28
29
30
31 public class MethodInvokersSupplierTest extends MethodFixtures {
32
33 @Test
34 public void testSupplierStaticGetMethod() throws NoSuchMethodException, SecurityException {
35 final Supplier<String> supplier = MethodInvokers.asSupplier(getMethodForStaticGetString());
36 assertEquals(staticGetString(), supplier.get());
37 assertEquals(staticGetString(), supplier.get());
38 }
39
40 @Test
41 public void testSupplierStaticGetMethodToString() throws SecurityException, ReflectiveOperationException {
42
43 final Supplier<Object> supplier = MethodInvokers.asSupplier(getMethodForStaticGetString());
44 assertFalse(supplier.toString().isEmpty());
45 assertFalse(supplier.toString().isEmpty());
46 }
47
48 }