use of org.cloudfoundry.uaa.clients.ChangeSecret in project cf-java-client by cloudfoundry.
the class ClientsTest method changeSecret.
@Test
public void changeSecret() {
String clientId = this.nameFactory.getClientId();
String newClientSecret = this.nameFactory.getClientSecret();
String oldClientSecret = this.nameFactory.getClientSecret();
requestCreateClient(this.uaaClient, clientId, oldClientSecret).then(this.uaaClient.clients().changeSecret(ChangeSecretRequest.builder().clientId(clientId).oldSecret(oldClientSecret).secret(newClientSecret).build())).as(StepVerifier::create).consumeErrorWith(t -> assertThat(t).isInstanceOf(UaaException.class).hasMessage("invalid_client: Only a client can change client secret")).verify(Duration.ofMinutes(5));
}
Aggregations