From 64a168e6b0c0dfe49ba36d1591cd2a246d0bd16c Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 22 Jul 2022 11:27:08 +0200 Subject: [PATCH] Fix test --- src/main/cljc/dda/c4k_gitea/gitea.cljc | 13 +++++++------ src/test/cljc/dda/c4k_gitea/gitea_test.cljc | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/cljc/dda/c4k_gitea/gitea.cljc b/src/main/cljc/dda/c4k_gitea/gitea.cljc index 5b7a5e0..f72cddf 100644 --- a/src/main/cljc/dda/c4k_gitea/gitea.cljc +++ b/src/main/cljc/dda/c4k_gitea/gitea.cljc @@ -24,7 +24,7 @@ (> 0 snd) (<= 65535 snd)))))) ;TODO: Maybe move to pred/comma-separated-fqdn-list? -(s/def ::mailer-domain-whitelist #(every? true? (map pred/fqdn-string? (str/split % #",")))) +(s/def ::service-domain-whitelist #(every? true? (map pred/fqdn-string? (str/split % #",")))) (s/def ::service-noreply-address pred/fqdn-string?) (s/def ::mailer-user pred/bash-env-string?) (s/def ::mailer-pw pred/bash-env-string?) @@ -33,7 +33,7 @@ (def config-defaults {:issuer "staging"}) (def config? (s/keys :req-un [::fqdn ::mailer-from ::mailer-host-port ::service-noreply-address] - :opt-un [::issuer ::default-app-name ::mailer-domain-whitelist])) + :opt-un [::issuer ::default-app-name ::service-domain-whitelist])) (def auth? (s/keys :req-un [::postgres/postgres-db-user ::postgres/postgres-db-password ::mailer-user ::mailer-pw])) @@ -62,10 +62,10 @@ fqdn mailer-from mailer-host-port - mailer-domain-whitelist + service-domain-whitelist service-noreply-address] :or {default-app-name "Gitea instance" - mailer-domain-whitelist fqdn}} + service-domain-whitelist fqdn}} config] (-> (yaml/load-as-edn "gitea/appini-env-configmap.yaml") @@ -74,7 +74,7 @@ (cm/replace-all-matching-values-by-new-value "URL" (str "https://" fqdn)) (cm/replace-all-matching-values-by-new-value "FROM" mailer-from) (cm/replace-all-matching-values-by-new-value "HOSTANDPORT" mailer-host-port) - (cm/replace-all-matching-values-by-new-value "WHITELISTDOMAINS" mailer-domain-whitelist) + (cm/replace-all-matching-values-by-new-value "WHITELISTDOMAINS" service-domain-whitelist) (cm/replace-all-matching-values-by-new-value "NOREPLY" service-noreply-address)))) (defn-spec generate-secrets pred/map-or-seq? @@ -102,4 +102,5 @@ (-> (yaml/load-as-edn "gitea/certificate.yaml") (assoc-in [:spec :issuerRef :name] letsencrypt-issuer) - (cm/replace-all-matching-values-by-new-value "FQDN" fqdn)))) \ No newline at end of file + (cm/replace-all-matching-values-by-new-value "FQDN" fqdn)))) + diff --git a/src/test/cljc/dda/c4k_gitea/gitea_test.cljc b/src/test/cljc/dda/c4k_gitea/gitea_test.cljc index e09299d..0aa160a 100644 --- a/src/test/cljc/dda/c4k_gitea/gitea_test.cljc +++ b/src/test/cljc/dda/c4k_gitea/gitea_test.cljc @@ -12,8 +12,8 @@ (st/instrument `cut/generate-secrets) (deftest should-generate-appini-env - (is (= {:GITEA__DEFAULT__APP_NAME-c1 "", - :GITEA__DEFAULT__APP_NAME-c2 "test gitea", + (is (= {:APP_NAME-c1 "", + :APP_NAME-c2 "test gitea", :GITEA__mailer__FROM-c1 "", :GITEA__mailer__FROM-c2 "test@test.com", :GITEA__mailer__HOST-c1 "", @@ -32,14 +32,14 @@ :fqdn "" :mailer-from "" :mailer-host-port "" - :service-whitelist-domains "" + :service-domain-whitelist "" :service-noreply-address "" }) (cut/generate-appini-env {:default-app-name "test gitea" :fqdn "test.com" :mailer-from "test@test.com" :mailer-host-port "mail.test.com:123" - :service-whitelist-domains "test.com,test.net" + :service-domain-whitelist "test.com,test.net" :service-noreply-address "noreply@test.com" })))))