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

Commit 5a04569

Browse files
author
Jose Luis Barrueta
authored
Merge pull request #1195 from stormpath/Issue-1194
1194 Rename abstract methods. Use correct app.
2 parents 5db9794 + b162510 commit 5a04569

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ xu/vQr6stjuzJIsDNAtW1FlG8WALOMjV
8686
return client.getResource(samlPolicy.getIdentityProvider().href, SamlIdentityProvider)
8787
}
8888

89-
protected SamlIdentityProvider getSamlIdentityProviderForDefaultApplication() {
90-
def app = client.currentTenant.getApplications(Applications.where(Applications.name().eqIgnoreCase("Stormpath"))).asList().get(0)
89+
protected SamlIdentityProvider getSamlIdentityProviderForAdministratorsApplication() {
90+
def app = client.currentTenant.getApplications(Applications.where(Applications.name().eqIgnoreCase("Stormpath"))).single()
9191
return getSamlIdentityProviderForApplication(app)
9292
}
9393

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ class RegisteredSamlServiceProviderIT extends AbstractSamlIT {
377377

378378
@Test
379379
void testSearchIdentityProviderCollectionOfRegisteredSamlServiceProvidersByDifferentProperties(){
380-
def identityProvider = getSamlIdentityProviderForDefaultApplication()
380+
def application = createTempApp()
381+
def identityProvider = getSamlIdentityProviderForApplication(application)
381382

382383
def serviceProvider = client.instantiate(RegisteredSamlServiceProvider)
383384
serviceProvider
@@ -425,7 +426,8 @@ class RegisteredSamlServiceProviderIT extends AbstractSamlIT {
425426

426427
@Test
427428
void testDeletion() {
428-
def identityProvider = getSamlIdentityProviderForDefaultApplication()
429+
def application = createTempApp()
430+
def identityProvider = getSamlIdentityProviderForApplication(application)
429431

430432
def serviceProvider = client.instantiate(RegisteredSamlServiceProvider)
431433
serviceProvider

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

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,27 @@ package com.stormpath.sdk.impl.saml
1818
import com.stormpath.sdk.account.Account
1919
import com.stormpath.sdk.application.Application
2020
import com.stormpath.sdk.application.webconfig.ApplicationWebConfig
21-
import com.stormpath.sdk.http.HttpMethod
22-
import com.stormpath.sdk.http.HttpRequest
23-
import com.stormpath.sdk.http.HttpRequestBuilder
24-
import com.stormpath.sdk.http.HttpRequests
2521
import com.stormpath.sdk.impl.ds.InternalDataStore
26-
import com.stormpath.sdk.impl.util.Base64
2722
import com.stormpath.sdk.query.Options
2823
import com.stormpath.sdk.resource.ResourceException
29-
import com.stormpath.sdk.saml.*
24+
import com.stormpath.sdk.saml.AttributeStatementMappingRule
25+
import com.stormpath.sdk.saml.AttributeStatementMappingRules
26+
import com.stormpath.sdk.saml.AuthnVerification
27+
import com.stormpath.sdk.saml.AuthnVerificationRequest
28+
import com.stormpath.sdk.saml.CreateSamlResponseRequest
29+
import com.stormpath.sdk.saml.RegisteredSamlServiceProvider
30+
import com.stormpath.sdk.saml.RegisteredSamlServiceProviderList
31+
import com.stormpath.sdk.saml.RegisteredSamlServiceProviders
32+
import com.stormpath.sdk.saml.SamlIdentityProvider
33+
import com.stormpath.sdk.saml.SamlIdentityProviderMetadata
34+
import com.stormpath.sdk.saml.SamlIdentityProviderStatus
35+
import com.stormpath.sdk.saml.SamlIdentityProviders
36+
import com.stormpath.sdk.saml.SamlPolicy
37+
import com.stormpath.sdk.saml.SamlResponse
38+
import com.stormpath.sdk.saml.SamlServiceProviderRegistration
39+
import com.stormpath.sdk.saml.SamlServiceProviderRegistrationList
40+
import com.stormpath.sdk.saml.SamlServiceProviderRegistrationStatus
41+
import com.stormpath.sdk.saml.SamlServiceProviderRegistrations
3042
import org.joda.time.format.DateTimeFormatter
3143
import org.joda.time.format.ISODateTimeFormat
3244
import org.testng.annotations.AfterMethod
@@ -62,8 +74,8 @@ class SamlIdentityProviderIT extends AbstractSamlIT {
6274
}
6375

6476
@Test
65-
public void samlPolicyForTheDefaulApplicationShouldHaveAnIdentityProvider() {
66-
getSamlIdentityProviderForDefaultApplication()
77+
public void samlPolicyForTheAdministrorsShouldHaveAnIdentityProvider() {
78+
getSamlIdentityProviderForAdministratorsApplication()
6779
}
6880

6981
@Test
@@ -130,7 +142,7 @@ class SamlIdentityProviderIT extends AbstractSamlIT {
130142

131143
@Test
132144
public void identityProviderForStormpathApplicationShouldBeDisabled() {
133-
def identityProvider = getSamlIdentityProviderForDefaultApplication()
145+
def identityProvider = getSamlIdentityProviderForAdministratorsApplication()
134146
assertNotNull(identityProvider.status)
135147
assertEquals(identityProvider.status, SamlIdentityProviderStatus.DISABLED)
136148
}
@@ -149,8 +161,8 @@ class SamlIdentityProviderIT extends AbstractSamlIT {
149161
}
150162

151163
@Test
152-
public void identityProviderForTheDefaultApplicationShouldHaveNullSsoLoginEndpoint() {
153-
def identityProvider = getSamlIdentityProviderForDefaultApplication()
164+
public void identityProviderForAdministratorApplicationShouldHaveNullSsoLoginEndpoint() {
165+
def identityProvider = getSamlIdentityProviderForAdministratorsApplication()
154166
assertNull(identityProvider.ssoLoginEndpoint)
155167
}
156168

0 commit comments

Comments
 (0)