Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Commit 10e3b95

Browse files
author
Jose Luis Barrueta
authored
Merge pull request #1213 from stormpath/Issue-1212
1212 Fix typo in header name.
2 parents c6aed42 + fe143b3 commit 10e3b95

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

extensions/httpclient/src/test/groovy/com/stormpath/sdk/client/ClientIT.groovy

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ import org.testng.annotations.BeforeClass
3939
import org.testng.annotations.BeforeTest
4040

4141
import static com.stormpath.sdk.application.Applications.newCreateRequestFor
42-
import static org.testng.Assert.assertEquals
43-
import static org.testng.Assert.assertTrue
42+
import static org.testng.Assert.*
4443

4544
abstract class ClientIT {
4645

@@ -167,28 +166,22 @@ abstract class ClientIT {
167166
}
168167

169168
protected void getDeletedResourceError(String href, Class resourceClass){
170-
Throwable e = null;
171169
try {
172170
client.getResource(href, resourceClass)
171+
fail("should have thrown ResourceException")
173172
} catch (ResourceException re) {
174-
e = re
175173
assertEquals(re.status, 404)
176174
assertEquals(re.getCode(), 404)
177175
}
178-
179-
assertTrue(e instanceof ResourceException)
180176
}
181177

182-
protected void updatedSaveableError(Saveable input, int expectedErrorCode){
183-
Throwable e = null;
178+
protected void updatedSaveableError(Saveable input, int expectedErrorCode) {
184179
try {
185180
input.save()
181+
fail("should have thrown ResourceException")
186182
} catch (ResourceException re) {
187-
e = re
188183
assertEquals(re.status, 400)
189184
assertEquals(re.getCode(), expectedErrorCode)
190185
}
191-
192-
assertTrue(e instanceof ResourceException)
193186
}
194187
}

extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/RegisteredSamlServiceProviderIT.groovy

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ class RegisteredSamlServiceProviderIT extends AbstractSamlIT {
7272

7373
@Test
7474
void testUniquenessOfRegisteredSamlServiceProviders() {
75+
def registeredSamlServiceProvider = createRegisteredSamlServiceProvider()
76+
77+
def registeredSamlServiceProvider2 = createRegisteredSamlServiceProvider()
78+
79+
registeredSamlServiceProvider.setEntityId(registeredSamlServiceProvider2.getEntityId())
80+
81+
updatedSaveableError(registeredSamlServiceProvider, 10110)
82+
}
83+
84+
RegisteredSamlServiceProvider createRegisteredSamlServiceProvider() {
7585
def registeredSamlServiceProvider = client.instantiate(RegisteredSamlServiceProvider)
7686
registeredSamlServiceProvider
7787
.setName("testName")
@@ -83,8 +93,7 @@ class RegisteredSamlServiceProviderIT extends AbstractSamlIT {
8393

8494
assertRegisteredSAMLServiceProviderFields(registeredSamlServiceProviderReturned, registeredSamlServiceProvider)
8595

86-
registeredSamlServiceProvider.setEntityId(registeredSamlServiceProvider.getEntityId())
87-
updatedSaveableError(registeredSamlServiceProvider, 10110)
96+
return registeredSamlServiceProviderReturned
8897
}
8998

9099
@Test

impl/src/main/java/com/stormpath/sdk/impl/http/HttpHeaders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class HttpHeaders implements MultiValueMap<String, String> {
7878

7979
public static final String STORMPATH_AGENT = "X-Stormpath-Agent";
8080

81-
public static final String STORMPATH_CLIENT_REQUEST_ID = "X-Stormapth-Client-Request-Id";
81+
public static final String STORMPATH_CLIENT_REQUEST_ID = "X-Stormpath-Client-Request-Id";
8282

8383
private static final String[] DATE_FORMATS = new String[]{
8484
"EEE, dd MMM yyyy HH:mm:ss zzz",

0 commit comments

Comments
 (0)