use of tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest in project teku by ConsenSys.
the class GetKeysTest method shouldListEmpytValidatorKeys.
@Test
void shouldListEmpytValidatorKeys() throws Exception {
final List<Validator> activeValidatorList = Collections.emptyList();
when(keyManager.getActiveValidatorKeys()).thenReturn(activeValidatorList);
final GetKeys endpoint = new GetKeys(keyManager);
final RestApiRequest request = mock(RestApiRequest.class);
endpoint.handle(request);
verify(request).respondOk(activeValidatorList);
}
use of tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest in project teku by ConsenSys.
the class GetRemoteKeysTest method shouldListEmptyValidatorKeys.
@Test
void shouldListEmptyValidatorKeys() throws Exception {
final List<ExternalValidator> activeRemoteValidatorList = Collections.emptyList();
when(keyManager.getActiveRemoteValidatorKeys()).thenReturn(activeRemoteValidatorList);
final GetRemoteKeys endpoint = new GetRemoteKeys(keyManager);
final RestApiRequest request = mock(RestApiRequest.class);
endpoint.handle(request);
verify(request).respondOk(Collections.emptyList());
}
use of tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest in project teku by ConsenSys.
the class GetRemoteKeysTest method shouldListValidatorKeys.
@Test
void shouldListValidatorKeys() throws Exception {
final List<ExternalValidator> activeRemoteValidatorList = getValidatorList().stream().map(val -> new ExternalValidator(val.getPublicKey(), val.getSigner().getSigningServiceUrl(), val.isReadOnly())).collect(Collectors.toList());
when(keyManager.getActiveRemoteValidatorKeys()).thenReturn(activeRemoteValidatorList);
final GetRemoteKeys endpoint = new GetRemoteKeys(keyManager);
final RestApiRequest request = mock(RestApiRequest.class);
endpoint.handle(request);
verify(request).respondOk(activeRemoteValidatorList);
}
use of tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest in project teku by ConsenSys.
the class GetKeysTest method shouldListValidatorKeys.
@Test
void shouldListValidatorKeys() throws Exception {
final List<Validator> activeValidatorList = getValidatorList();
when(keyManager.getActiveValidatorKeys()).thenReturn(activeValidatorList);
final GetKeys endpoint = new GetKeys(keyManager);
final RestApiRequest request = mock(RestApiRequest.class);
endpoint.handle(request);
verify(request).respondOk(activeValidatorList);
}
Aggregations