-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in SHIBUI-468 (pull request #72)
SHIBUI-468 * [SHIBUI-440] Unit test additions WIP * [SHIBUI-440] Added simple tests to ensure that file creation and deletion happens as expected. * [SHIBUI-440] Heavily refactored JPAEntityServiceImpl.getAttributeListFromEntityRepresentation. Added more tests in an attempt to increase coverage. Removed a couple default constructors. Added a helper util for counting attributes from a RelyingPartyOverridesRepresentation. This could maybe use a better name. * [SHIBUI-440] Added a unit test to check for the exception that we always throw here. * [SHIBUI-440] Added a WIP unit test. There are a few that still need to be added to this class. * [SHIBUI-468] Added tests for XML-related POSTs/GETs of EntityDescriptors, * [SHIBUI-468] Added simple auth test.
- Loading branch information
Bill Smith
authored and
Jonathan Johnson
committed
May 17, 2018
1 parent
fcb0b88
commit 072c3c3
Showing
10 changed files
with
712 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...nternet2/tier/shibboleth/admin/ui/controller/DefaultAuthenticationIntegrationTests.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.controller | ||
|
||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.boot.test.context.SpringBootTest | ||
import org.springframework.test.context.ActiveProfiles | ||
import org.springframework.test.web.reactive.server.WebTestClient | ||
import org.springframework.web.util.DefaultUriBuilderFactory | ||
import spock.lang.Specification | ||
|
||
/** | ||
* @author Bill Smith (wsmith@unicon.net) | ||
*/ | ||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | ||
@ActiveProfiles("default") | ||
class DefaultAuthenticationIntegrationTests extends Specification { | ||
|
||
@Autowired | ||
private WebTestClient webClient | ||
|
||
def setup() { | ||
this.webClient.webClient.uriBuilderFactory.encodingMode = DefaultUriBuilderFactory.EncodingMode.NONE | ||
} | ||
|
||
def "When auth is enabled and an unauth'd request is made, a 302 is returned which points at login"() { | ||
when: | ||
def result = this.webClient | ||
.get() | ||
.uri("/api/entities/http%3A%2F%2Ftest.scaldingspoon.org%2Ftest1") | ||
.exchange() | ||
|
||
then: | ||
result | ||
.expectStatus().isEqualTo(302) | ||
.expectHeader().valueMatches("Location", "http://localhost:\\d*/login") | ||
} | ||
} |
Oops, something went wrong.