Skip to content

Commit

Permalink
WIP2
Browse files Browse the repository at this point in the history
  • Loading branch information
dima767 committed Feb 22, 2021
1 parent 2158e0a commit 867c540
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -398,3 +398,5 @@ rdurable

#Local build with no tests script wrapper
build-no-tests

beacon/spring/out
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class EntityDescriptorControllerVersionEndpointsIntegrationTests extends Specifi
edv2.body.serviceProviderName == 'SP2'
}

@DirtiesContext(methodMode = DirtiesContext.MethodMode.AFTER_METHOD)
//@DirtiesContext(methodMode = DirtiesContext.MethodMode.AFTER_METHOD)
def 'SHIBUI-1414'() {
given:
def ed = new EntityDescriptor(entityID: 'testme', serviceProviderName: 'testme').with {
Expand All @@ -125,15 +125,14 @@ class EntityDescriptorControllerVersionEndpointsIntegrationTests extends Specifi
})
entityDescriptorRepository.save(it)
}

when:
def headers = new HttpHeaders().with {
it.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
it
}

def allVersions = getAllEntityDescriptorVersions(ed.resourceId, List)
def edv1 = getEntityDescriptorForVersion(ed.resourceId, allVersions.body[0].id, String).body
String edv1 = getEntityDescriptorForVersion(ed.resourceId, allVersions.body[0].id, String).body
def tedv2 = getEntityDescriptorForVersion(ed.resourceId, allVersions.body[1].id, EntityDescriptorRepresentation).body

def aedv1 = new JsonSlurper().parseText(edv1).with {
Expand Down
2 changes: 2 additions & 0 deletions backend/src/enversTest/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
spring.main.allow-bean-definition-overriding=true

spring.liquibase.enabled=false

#Needed in the latest versions of Spring Boot when doing manual transaction management like we do in envers versioning code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import static edu.internet2.tier.shibboleth.admin.ui.jsonschema.LowLevelJsonSche
*
* @author Dmitriy Kopylenko
*/
@ControllerAdvice
//@ControllerAdvice
class EntityDescriptorSchemaValidatingControllerAdvice extends RequestBodyAdviceAdapter {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.springframework.core.io.ClassPathResource
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.web.reactive.server.WebTestClient
import org.springframework.test.web.servlet.result.MockMvcResultHandlers
import org.springframework.web.reactive.function.client.WebClient
import org.springframework.web.util.DefaultUriBuilderFactory
import org.xmlunit.builder.DiffBuilder
import org.xmlunit.builder.Input
Expand All @@ -35,7 +36,11 @@ class EntitiesControllerIntegrationTests extends Specification {
private WebTestClient webClient

def setup() {
//DefaultUriBuilderFactory factory = new DefaultUriBuilderFactory()
//factory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE)

// yeah, don't ask... this is just shenanigans
this.webClient = WebTestClient.builder().uriBuilderFactory(factory).build()
this.webClient.webClient.uriBuilderFactory.encodingMode = DefaultUriBuilderFactory.EncodingMode.NONE
}

Expand All @@ -60,7 +65,11 @@ class EntitiesControllerIntegrationTests extends Specification {
when:
def result = this.webClient
.get()
.uri("/api/entities/http%3A%2F%2Ftest.scaldingspoon.org%2Ftest1")
.uri {
it.path("/api/entities/http%3A%2F%2Ftest.scaldingspoon.org%2Ftest1")
it.build()
}
//.uri("/api/entities/http%3A%2F%2Ftest.scaldingspoon.org%2Ftest1")
.exchange() // someday, I'd like to know why IntelliJ "cannot resolve symbol 'exchange'"

then:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public BeaconPublishingTask(DefaultBeaconPublisher beaconPublisher) {
}

//Cron is based on the spec defined here: https://spaces.at.internet2.edu/display/TWGH/TIER+Instrumentation+-+The+TIER+Beacon
@Scheduled(cron = "0 ${random.int[0,59]} ${random.int[0,3]} ? * *}")
@Scheduled(cron = "0 ${random.int[0,59]} ${random.int[0,3]} ? * *")
@Async
void publish() {
logger.debug("Publishing payload: {} to beacon endpoint: {}",
Expand Down

0 comments on commit 867c540

Please sign in to comment.