Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Commit 7ab448b

Browse files
author
Richard Blaylock
committed
Issue-1136 Fix time zone in test.
1 parent 80dfda8 commit 7ab448b

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/SamlIdentityProviderIT.groovy

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import org.testng.annotations.AfterMethod
3333
import org.testng.annotations.Test
3434

3535
import javax.xml.bind.DatatypeConverter
36+
import java.text.DateFormat
3637
import java.text.SimpleDateFormat
3738

3839
import static org.testng.Assert.assertEquals
@@ -593,7 +594,9 @@ yl85oFHAdkguTA==
593594
AuthnVerification authnVerification = identityProvider.createAuthnVerification(authnVerificationRequest)
594595
assertEquals(authnVerification.relayState, cannedRelayState)
595596
assertEquals(authnVerification.serviceProvider.href, registeredSamlServiceProvider.href)
596-
Date cannedDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse("2016-12-13T13:55:12.280Z")
597+
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
598+
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"))
599+
Date cannedDate = dateFormat.parse("2016-12-13T21:55:12.280Z")
597600
assertEquals(authnVerification.authnIssueInstant, cannedDate)
598601
}
599602

@@ -628,13 +631,4 @@ yl85oFHAdkguTA==
628631
assertTrue(xml.contains("InResponseTo=\"" + requestId + "\""))
629632
}
630633

631-
def static String createBasicAuthzHeader(String id, String secret) {
632-
633-
String cred = id + ":" + secret
634-
635-
byte[] bytes = cred.getBytes("UTF-8")
636-
637-
"Basic " + Base64.encodeBase64String(bytes)
638-
}
639-
640634
}

0 commit comments

Comments
 (0)