From f942bea380b46f7e6b2897bf709b4a08be62522e Mon Sep 17 00:00:00 2001 From: chasegawa Date: Wed, 9 Jun 2021 18:02:36 -0700 Subject: [PATCH] SHIBUI-1807 Added missing index field to the representation --- ...ssertionConsumerServiceRepresentation.java | 32 ++++--------------- .../JPAEntityDescriptorServiceImpl.java | 1 + ...JPAEntityDescriptorServiceImplTests.groovy | 6 ++-- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/frontend/AssertionConsumerServiceRepresentation.java b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/frontend/AssertionConsumerServiceRepresentation.java index 17b50b11b..d178372a4 100644 --- a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/frontend/AssertionConsumerServiceRepresentation.java +++ b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/domain/frontend/AssertionConsumerServiceRepresentation.java @@ -2,8 +2,12 @@ import java.io.Serializable; -public class AssertionConsumerServiceRepresentation implements Serializable { +import lombok.Getter; +import lombok.Setter; +@Getter +@Setter +public class AssertionConsumerServiceRepresentation implements Serializable { private static final long serialVersionUID = 7610150456756113460L; private String locationUrl; @@ -11,28 +15,6 @@ public class AssertionConsumerServiceRepresentation implements Serializable { private String binding; private boolean makeDefault; - - public String getLocationUrl() { - return locationUrl; - } - - public void setLocationUrl(String locationUrl) { - this.locationUrl = locationUrl; - } - - public String getBinding() { - return binding; - } - - public void setBinding(String binding) { - this.binding = binding; - } - - public boolean isMakeDefault() { - return makeDefault; - } - - public void setMakeDefault(boolean makeDefault) { - this.makeDefault = makeDefault; - } + + private Integer index; } diff --git a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImpl.java b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImpl.java index 7be97f308..743e56981 100644 --- a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImpl.java +++ b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImpl.java @@ -168,6 +168,7 @@ void setupACSs(EntityDescriptor ed, EntityDescriptorRepresentation representatio } assertionConsumerService.setBinding(acsRepresentation.getBinding()); assertionConsumerService.setLocation(acsRepresentation.getLocationUrl()); + assertionConsumerService.setIndex(acsRepresentation.getIndex()); } } else { ed.getOptionalSPSSODescriptor().ifPresent(spssoDescriptor -> spssoDescriptor.getAssertionConsumerServices().clear()); diff --git a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImplTests.groovy b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImplTests.groovy index 6b5fd4214..3d05ae598 100644 --- a/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImplTests.groovy +++ b/backend/src/test/groovy/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImplTests.groovy @@ -528,8 +528,8 @@ class JPAEntityDescriptorServiceImplTests extends Specification { xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" entityID="http://test.example.org/test1"> - - + + ''' @@ -539,12 +539,14 @@ class JPAEntityDescriptorServiceImplTests extends Specification { new AssertionConsumerServiceRepresentation().with { it.binding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' it.locationUrl = 'https://test.example.org/SAML/POST' + it.index = 2 it }, new AssertionConsumerServiceRepresentation().with { it.binding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' it.locationUrl = 'https://test.example.org/SAML/GET' it.makeDefault = true + it.index = 1 it } ]