summaryrefslogtreecommitdiffstats
path: root/model/saml_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-03-13 08:26:23 -0400
committerGeorge Goldberg <george@gberg.me>2017-03-13 12:26:23 +0000
commit3559fb7959cf008b038239f2e7c43e604c44cd31 (patch)
tree159fdbb16a169926e0d142aa17d6086fcded62c4 /model/saml_test.go
parentfe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81 (diff)
downloadchat-3559fb7959cf008b038239f2e7c43e604c44cd31.tar.gz
chat-3559fb7959cf008b038239f2e7c43e604c44cd31.tar.bz2
chat-3559fb7959cf008b038239f2e7c43e604c44cd31.zip
Implement SAML endpoints for APIv4 (#5671)
* Implement SAML endpoints for APIv4 * Fix unit test * Only disable encryption when removing puplic/private certs
Diffstat (limited to 'model/saml_test.go')
-rw-r--r--model/saml_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/model/saml_test.go b/model/saml_test.go
new file mode 100644
index 000000000..578e78da5
--- /dev/null
+++ b/model/saml_test.go
@@ -0,0 +1,24 @@
+// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package model
+
+import (
+ "strings"
+ "testing"
+)
+
+func TestSamlCertificateStatusJson(t *testing.T) {
+ status := &SamlCertificateStatus{IdpCertificateFile: true, PrivateKeyFile: true, PublicCertificateFile: true}
+ json := status.ToJson()
+ rstatus := SamlCertificateStatusFromJson(strings.NewReader(json))
+
+ if status.IdpCertificateFile != rstatus.IdpCertificateFile {
+ t.Fatal("IdpCertificateFile do not match")
+ }
+
+ rstatus = SamlCertificateStatusFromJson(strings.NewReader("junk"))
+ if rstatus != nil {
+ t.Fatal("should be nil")
+ }
+}