Search in sources :

Example 1 with ThrottlingTaskQueue

use of tech.pegasys.teku.infrastructure.async.ThrottlingTaskQueue in project teku by ConsenSys.

the class ExternalValidatorSourceTest method setup.

@BeforeEach
void setup(@TempDir Path tempDir) throws IOException, InterruptedException {
    config = ValidatorConfig.builder().validatorExternalSignerUrl(new URL("http://localhost:9000")).build();
    externalSignerTaskQueue = new ThrottlingTaskQueue(config.getValidatorExternalSignerConcurrentRequestLimit(), metricsSystem, TekuMetricCategory.VALIDATOR, "external_signer_request_queue_size");
    when(httpResponse.statusCode()).thenReturn(SC_OK);
    when(httpClient.send(any(), ArgumentMatchers.<HttpResponse.BodyHandler<Void>>any())).thenReturn(httpResponse);
    validatorSource = newExternalValidatorSource(tempDir, true);
}
Also used : ThrottlingTaskQueue(tech.pegasys.teku.infrastructure.async.ThrottlingTaskQueue) HttpResponse(java.net.http.HttpResponse) URL(java.net.URL) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

URL (java.net.URL)1 HttpResponse (java.net.http.HttpResponse)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 ThrottlingTaskQueue (tech.pegasys.teku.infrastructure.async.ThrottlingTaskQueue)1