@Test(dependsOnMethods = "requestClientAssociate2") public void requestClientUpdate() throws Exception { showTitle("requestClientUpdate"); final String logoUriNewValue = "http://www.gluu.org/test/yuriy/logo.png"; final String contact1NewValue = "yuriy@gluu.org"; final String contact2NewValue = "yuriyz@gmail.com"; final RegisterRequest registerRequest = new RegisterRequest(registrationAccessToken1); registerRequest.setHttpMethod(HttpMethod.PUT); registerRequest.setContacts(Arrays.asList(contact1NewValue, contact2NewValue)); registerRequest.setLogoUri(logoUriNewValue); final RegisterClient registerClient = new RegisterClient(registrationClientUri1); registerClient.setRequest(registerRequest); registerClient.setExecutor(clientExecutor(true)); final RegisterResponse response = registerClient.exec(); showClient(registerClient); assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity()); assertNotNull(response.getClientId()); // check whether info is really updated final String responseContacts = response.getClaims().get(CONTACTS.toString()); final String responseLogoUri = response.getClaims().get(LOGO_URI.toString()); assertTrue(responseContacts.contains(contact1NewValue) && responseContacts.contains(contact2NewValue)); assertNotNull(responseLogoUri.equals(logoUriNewValue)); }
registerRequest.setHttpMethod(HttpMethod.PUT);
@Test(dependsOnMethods = "requestClientAssociate") public void requestClientUpdate() throws Exception { showTitle("requestClientUpdate"); final String redirectUris = "https://www.attacker.com"; final RegisterRequest registerRequest = new RegisterRequest(registrationAccessToken1); registerRequest.setHttpMethod(HttpMethod.PUT); registerRequest.setRedirectUris(StringUtils.spaceSeparatedToList(redirectUris)); final RegisterClient registerClient = new RegisterClient(registrationClientUri1); registerClient.setRequest(registerRequest); registerClient.setExecutor(clientExecutor(true)); final RegisterResponse response = registerClient.exec(); showClient(registerClient); assertEquals(response.getStatus(), 400, "Unexpected response code: " + response.getEntity()); assertNotNull(response.getEntity(), "The entity is null"); assertNotNull(response.getErrorType(), "The error type is null"); assertNotNull(response.getErrorDescription(), "The error description is null"); } }