diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/client/ClientIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/client/ClientIT.groovy index 21b2a0452b..84cc9f925f 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/client/ClientIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/client/ClientIT.groovy @@ -39,8 +39,7 @@ import org.testng.annotations.BeforeClass import org.testng.annotations.BeforeTest import static com.stormpath.sdk.application.Applications.newCreateRequestFor -import static org.testng.Assert.assertEquals -import static org.testng.Assert.assertTrue +import static org.testng.Assert.* abstract class ClientIT { @@ -167,28 +166,22 @@ abstract class ClientIT { } protected void getDeletedResourceError(String href, Class resourceClass){ - Throwable e = null; try { client.getResource(href, resourceClass) + fail("should have thrown ResourceException") } catch (ResourceException re) { - e = re assertEquals(re.status, 404) assertEquals(re.getCode(), 404) } - - assertTrue(e instanceof ResourceException) } - protected void updatedSaveableError(Saveable input, int expectedErrorCode){ - Throwable e = null; + protected void updatedSaveableError(Saveable input, int expectedErrorCode) { try { input.save() + fail("should have thrown ResourceException") } catch (ResourceException re) { - e = re assertEquals(re.status, 400) assertEquals(re.getCode(), expectedErrorCode) } - - assertTrue(e instanceof ResourceException) } } diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/RegisteredSamlServiceProviderIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/RegisteredSamlServiceProviderIT.groovy index 774a1fb676..5c4cd84f6f 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/RegisteredSamlServiceProviderIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/RegisteredSamlServiceProviderIT.groovy @@ -72,6 +72,16 @@ class RegisteredSamlServiceProviderIT extends AbstractSamlIT { @Test void testUniquenessOfRegisteredSamlServiceProviders() { + def registeredSamlServiceProvider = createRegisteredSamlServiceProvider() + + def registeredSamlServiceProvider2 = createRegisteredSamlServiceProvider() + + registeredSamlServiceProvider.setEntityId(registeredSamlServiceProvider2.getEntityId()) + + updatedSaveableError(registeredSamlServiceProvider, 10110) + } + + RegisteredSamlServiceProvider createRegisteredSamlServiceProvider() { def registeredSamlServiceProvider = client.instantiate(RegisteredSamlServiceProvider) registeredSamlServiceProvider .setName("testName") @@ -83,8 +93,7 @@ class RegisteredSamlServiceProviderIT extends AbstractSamlIT { assertRegisteredSAMLServiceProviderFields(registeredSamlServiceProviderReturned, registeredSamlServiceProvider) - registeredSamlServiceProvider.setEntityId(registeredSamlServiceProvider.getEntityId()) - updatedSaveableError(registeredSamlServiceProvider, 10110) + return registeredSamlServiceProviderReturned } @Test diff --git a/impl/src/main/java/com/stormpath/sdk/impl/http/HttpHeaders.java b/impl/src/main/java/com/stormpath/sdk/impl/http/HttpHeaders.java index 77fe275659..08a689e0cb 100644 --- a/impl/src/main/java/com/stormpath/sdk/impl/http/HttpHeaders.java +++ b/impl/src/main/java/com/stormpath/sdk/impl/http/HttpHeaders.java @@ -78,7 +78,7 @@ public class HttpHeaders implements MultiValueMap { public static final String STORMPATH_AGENT = "X-Stormpath-Agent"; - public static final String STORMPATH_CLIENT_REQUEST_ID = "X-Stormapth-Client-Request-Id"; + public static final String STORMPATH_CLIENT_REQUEST_ID = "X-Stormpath-Client-Request-Id"; private static final String[] DATE_FORMATS = new String[]{ "EEE, dd MMM yyyy HH:mm:ss zzz",