Merge pull request #3377 from stianst/KEYCLOAK-3706

KEYCLOAK-3706
This commit is contained in:
Stian Thorgersen 2016-10-19 19:55:36 +02:00 committed by GitHub
commit 473bd5fc78

View file

@ -109,7 +109,9 @@ public class RegistrationAccessTokenTest extends AbstractClientRegistrationTest
@Test
public void getClientWithBadRegistrationToken() throws ClientRegistrationException {
reg.auth(Auth.token("invalid"));
String oldToken = client.getRegistrationAccessToken();
reg.update(client);
reg.auth(Auth.token(oldToken));
try {
reg.get(client.getClientId());
fail("Expected 401");
@ -134,9 +136,9 @@ public class RegistrationAccessTokenTest extends AbstractClientRegistrationTest
@Test
public void updateClientWithBadRegistrationToken() throws ClientRegistrationException {
client.setRootUrl("http://newroot");
reg.auth(Auth.token("invalid"));
String oldToken = client.getRegistrationAccessToken();
reg.update(client);
reg.auth(Auth.token(oldToken));
try {
reg.update(client);
fail("Expected 401");
@ -155,7 +157,9 @@ public class RegistrationAccessTokenTest extends AbstractClientRegistrationTest
@Test
public void deleteClientWithBadRegistrationToken() throws ClientRegistrationException {
reg.auth(Auth.token("invalid"));
String oldToken = client.getRegistrationAccessToken();
reg.update(client);
reg.auth(Auth.token(oldToken));
try {
reg.delete(client);
fail("Expected 401");