Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Apr 29, 2023
1 parent f43f171 commit a4a58ac
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.web.reactive.function.client.WebClient;
import org.testfx.util.WaitForAsyncUtils;
import reactor.core.publisher.Mono;
import reactor.netty.http.client.HttpClient;
import reactor.test.StepVerifier;

Expand All @@ -53,6 +54,7 @@
import static org.hamcrest.Matchers.containsString;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.when;

public class FafApiAccessorTest extends ServiceTest {

Expand All @@ -61,6 +63,7 @@ public class FafApiAccessorTest extends ServiceTest {
@Mock
private EventBus eventBus;
@Mock
private TokenService tokenService;
private OAuthTokenFilter oAuthTokenFilter;
@TempDir
public Path tempDirectory;
Expand Down Expand Up @@ -92,6 +95,7 @@ public void setUp() throws Exception {
clientCodecConfigurer.customCodecs().register(jsonApiReader);
clientCodecConfigurer.customCodecs().register(jsonApiWriter);
});
when(tokenService.getRefreshedTokenValue()).thenReturn(Mono.just(""));

mockApi = new MockWebServer();
mockApi.start();
Expand All @@ -101,6 +105,7 @@ public void setUp() throws Exception {
api.setMaxPageSize(100);
api.setBaseUrl(String.format("http://localhost:%s", mockApi.getPort()));
api.setRetryBackoffSeconds(0);
oAuthTokenFilter = new OAuthTokenFilter(tokenService);
instance = new FafApiAccessor(eventBus, clientProperties, oAuthTokenFilter, webClientBuilder);
instance.afterPropertiesSet();
instance.authorize();
Expand Down

0 comments on commit a4a58ac

Please sign in to comment.