From 361a34dfc71f091cb9cd32665c79045513a0a219 Mon Sep 17 00:00:00 2001 From: chasegawa Date: Fri, 23 Sep 2022 10:55:05 -0700 Subject: [PATCH] SHIBUI-2380 Incremental commit: - unit tests and code corrections --- .../EntityDescriptorConversionUtilsTests.groovy | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/util/EntityDescriptorConversionUtilsTests.groovy b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/util/EntityDescriptorConversionUtilsTests.groovy index c04106582..204ffaf52 100644 --- a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/util/EntityDescriptorConversionUtilsTests.groovy +++ b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/util/EntityDescriptorConversionUtilsTests.groovy @@ -51,37 +51,38 @@ class EntityDescriptorConversionUtilsTests extends Specification { given: def expectedXml = ''' + testName testValue ''' - def expected = openSAMLObjects.unmarshallFromXml(expectedXml.bytes, KeyDescriptor) - expected.name = 'testName' when: def keyDescriptor = EntityDescriptorConversionUtils.createKeyDescriptor('testName', 'signing', 'testValue', KeyDescriptorRepresentation.ElementType.X509Data) + def generated = openSAMLObjects.marshalToXmlString(keyDescriptor) then: - assert keyDescriptor == expected + TestHelpers.generatedXmlIsTheSameAsExpectedXml(expectedXml, generated) } def "test createKeyDescriptor, both type"() { given: def expectedXml = ''' + testName testValue ''' - def expected = openSAMLObjects.unmarshallFromXml(expectedXml.bytes, KeyDescriptor) - expected.name = 'testName' when: def keyDescriptor = EntityDescriptorConversionUtils.createKeyDescriptor('testName', 'both', 'testValue', KeyDescriptorRepresentation.ElementType.X509Data) + def generated = openSAMLObjects.marshalToXmlString(keyDescriptor) + then: - assert keyDescriptor == expected + TestHelpers.generatedXmlIsTheSameAsExpectedXml(expectedXml, generated) } def 'test createKeyDescriptor equality'() {