Skip to content

Commit

Permalink
remove unneeded test
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Sep 16, 2024
1 parent 68aa851 commit 60af3f9
Showing 1 changed file with 0 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@

import io.vrap.rmf.base.client.*;
import io.vrap.rmf.base.client.error.*;
import io.vrap.rmf.base.client.oauth2.TokenSupplier;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.ExtendWith;

Expand Down Expand Up @@ -77,34 +75,6 @@ public void testHttpCounts(int statusCode, int count, int errorCount) throws URI
Assertions.assertThat(middleware.errorCount).isEqualTo(errorCount);
}

@Test
public void testUnauthorized() throws URISyntaxException {
TestTelemetryMiddleware middleware = new TestTelemetryMiddleware();

ApiHttpClient client = ClientBuilder
.of(new TestHttpClient(request -> CompletableFuture
.completedFuture(new ApiHttpResponse<>(200, new ApiHttpHeaders(), "".getBytes()))))
.withApiBaseUrl(new URI(""))
.withTokenSupplier((TokenSupplier) () -> {
throw new UnauthorizedException(401, "", null, "", null);
})
.withTelemetryMiddleware(middleware)
.withErrorMiddleware()
.build();

final ApiHttpRequest request = new ApiHttpRequest(ApiHttpMethod.GET, URI.create("/"), new ApiHttpHeaders(),
"".getBytes());
try {
blockingWait(client.execute(request), Duration.ofSeconds(1));
}
catch (ApiHttpException ignored) {
int i = 1;
}

Assertions.assertThat(middleware.count).isEqualTo(1);
Assertions.assertThat(middleware.errorCount).isEqualTo(1);
}

static class TestHttpClient implements VrapHttpClient {
private final Function<ApiHttpRequest, CompletableFuture<ApiHttpResponse<byte[]>>> next;

Expand Down

0 comments on commit 60af3f9

Please sign in to comment.