Search in sources :

Example 1 with EzySupplier

use of com.tvd12.ezyfox.function.EzySupplier in project ezyhttp by youngmonkeys.

the class ResourceLoaderTest method addURLsToSetTest.

@Test
public void addURLsToSetTest() {
    // given
    ResourceLoader sut = new ResourceLoader();
    Set<URL> answer = new HashSet<>();
    Exception exception = new Exception("just test");
    EzySupplier<Enumeration<URL>> supplier = () -> {
        throw exception;
    };
    // when
    MethodInvoker.create().object(sut).method("addURLsToSet").param(Set.class, answer).param(EzySupplier.class, supplier).invoke();
    // then
    Asserts.assertTrue(answer.isEmpty());
}
Also used : ResourceLoader(com.tvd12.ezyhttp.server.core.resources.ResourceLoader) EzySupplier(com.tvd12.ezyfox.function.EzySupplier) URL(java.net.URL) MalformedURLException(java.net.MalformedURLException) Test(org.testng.annotations.Test)

Aggregations

EzySupplier (com.tvd12.ezyfox.function.EzySupplier)1 ResourceLoader (com.tvd12.ezyhttp.server.core.resources.ResourceLoader)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 Test (org.testng.annotations.Test)1