Skip to content

Commit

Permalink
tests: add executorService test
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoepics committed Apr 30, 2024
1 parent c8a9620 commit 610c7b4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/java/io/github/brenoepics/at4j/AzureApiBuilderTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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.*;

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 610c7b4

Please sign in to comment.