-
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.
- Loading branch information
Showing
10 changed files
with
116 additions
and
554 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
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
49 changes: 49 additions & 0 deletions
49
...h/admin/ui/controller/BadJSONMetadataSourcesUiDefinitionControllerIntegrationTests.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,49 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.controller | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import edu.internet2.tier.shibboleth.admin.ui.jsonschema.MetadataSourcesJsonSchemaResourceLocation | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.boot.test.context.SpringBootTest | ||
import org.springframework.boot.test.context.TestConfiguration | ||
import org.springframework.boot.test.web.client.TestRestTemplate | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.core.io.ResourceLoader | ||
import org.springframework.test.context.ActiveProfiles | ||
import spock.lang.Specification | ||
|
||
/** | ||
* @author Dmitriy Kopylenko | ||
*/ | ||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | ||
@ActiveProfiles("no-auth") | ||
class BadJSONMetadataSourcesUiDefinitionControllerIntegrationTests extends Specification { | ||
|
||
@Autowired | ||
private TestRestTemplate restTemplate | ||
|
||
@Autowired | ||
MetadataSourcesJsonSchemaResourceLocation schemaLocation | ||
|
||
static RESOURCE_URI = '/api/ui/MetadataSources' | ||
|
||
def "GET Malformed Metadata Sources UI definition schema"() { | ||
when: 'GET request is made for malformed metadata source UI definition schema' | ||
def result = this.restTemplate.getForEntity(RESOURCE_URI, Object) | ||
|
||
then: "Request results in HTTP 500" | ||
result.statusCodeValue == 500 | ||
result.body.jsonParseError | ||
result.body.sourceUiSchemaDefinitionFile | ||
} | ||
|
||
@TestConfiguration | ||
static class Config { | ||
@Bean | ||
MetadataSourcesJsonSchemaResourceLocation metadataSourcesJsonSchemaResourceLocation(ResourceLoader resourceLoader, | ||
ObjectMapper jacksonMapper) { | ||
|
||
new MetadataSourcesJsonSchemaResourceLocation('classpath:metadata-sources-ui-schema_MALFORMED.json', | ||
resourceLoader, jacksonMapper, false) | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
.../admin/ui/controller/GoodJSONMetadataSourcesUiDefinitionControllerIntegrationTests.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,29 @@ | ||
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.boot.test.web.client.TestRestTemplate | ||
import org.springframework.test.context.ActiveProfiles | ||
import spock.lang.Specification | ||
|
||
/** | ||
* @author Dmitriy Kopylenko | ||
*/ | ||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | ||
@ActiveProfiles("no-auth") | ||
class GoodJSONMetadataSourcesUiDefinitionControllerIntegrationTests extends Specification { | ||
|
||
@Autowired | ||
private TestRestTemplate restTemplate | ||
|
||
static RESOURCE_URI = '/api/ui/MetadataSources' | ||
|
||
def "GET Metadata Sources UI definition schema"() { | ||
when: 'GET request is made for metadata source UI definition schema' | ||
def result = this.restTemplate.getForEntity(RESOURCE_URI, Object) | ||
|
||
then: "Request completed successfully" | ||
result.statusCodeValue == 200 | ||
result.body.properties.entityId.title == 'label.entity-id' | ||
} | ||
} |
74 changes: 0 additions & 74 deletions
74
...ibboleth/admin/ui/controller/MetadataSourcesUiDefinitionControllerIntegrationTests.groovy
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.