diff --git a/src/test/java/io/github/brenoepics/at4j/AzureApiBuilderTest.java b/src/test/java/io/github/brenoepics/at4j/AzureApiBuilderTest.java index fadede1..7a2d1b6 100644 --- a/src/test/java/io/github/brenoepics/at4j/AzureApiBuilderTest.java +++ b/src/test/java/io/github/brenoepics/at4j/AzureApiBuilderTest.java @@ -1,6 +1,7 @@ package io.github.brenoepics.at4j; import io.github.brenoepics.at4j.azure.lang.Language; +import io.github.brenoepics.at4j.core.thread.ThreadPoolImpl; import io.github.brenoepics.at4j.data.request.AvailableLanguagesParams; import org.junit.jupiter.api.Test; import io.github.brenoepics.at4j.azure.BaseURL; @@ -12,6 +13,7 @@ import java.time.Duration; import java.util.Collection; import java.util.Optional; +import java.util.concurrent.ExecutorService; import static org.junit.jupiter.api.Assertions.*; @@ -51,6 +53,14 @@ void shouldSetSubscriptionRegionWhenProvided() { assertEquals("brazilsouth", api.getSubscriptionRegion().orElse(null)); } + @Test + void shouldSetThreadPoolWhenProvided() { + ExecutorService executorService = ThreadPoolImpl.newAt4jDefault(); + AzureApiBuilder builder = new AzureApiBuilder().setKey("testKey").executorService(executorService); + AzureApi api = builder.build(); + assertEquals(executorService, api.getThreadPool().getExecutorService()); + } + @Test void shouldSetAllParameters() throws NoSuchAlgorithmException { ProxySelector selector = ProxySelector.getDefault();