| 1 | package e2e_testscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/ |
| 2 | |
| 3 | import ( |
| 4 | "osscip-go gomod github.com/golang/go/src . os/" |
| 5 | |
| 6 | "github.com/onsi/ginkgo/v2scip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/" |
| 7 | "github.com/onsi/gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/" |
| 8 | |
| 9 | "github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfyscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/" |
| 10 | ) |
| 11 | |
| 12 | var _ = ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Describescip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/Describe().("ntfy E2E Config Tests", func() { |
| 13 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Whenscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/When().("running e2e tests against a real ntfy server", func() { |
| 14 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.BeforeEachscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/BeforeEach().(func() { |
| 15 | if !isNtfyServerAvailablescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/isNtfyServerAvailable().() { |
| 16 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Skipscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/Skip().("ntfy server not available, skipping e2e tests") |
| 17 | } |
| 18 | }) |
| 19 | |
| 20 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Itscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/It().("should initialize with default configuration", func() { |
| 21 | serviceURLStr := buildServiceURLscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/buildServiceURL().() |
| 22 | service := initializeServicescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/initializeService().(serviceURLStr) |
| 23 | |
| 24 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..Topicscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#Topic.).NotToscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.BeEmptyscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/BeEmpty().()) |
| 25 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..Hostscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#Host.).NotToscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#NotTo().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.BeEmptyscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/BeEmpty().()) |
| 26 | }) |
| 27 | |
| 28 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Itscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/It().("should initialize with credentials from URL", func() { |
| 29 | serviceURLStr := buildServiceURLscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/buildServiceURL().() |
| 30 | service := initializeServicescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/initializeService().(serviceURLStr) |
| 31 | |
| 32 | username := osscip-go gomod github.com/golang/go/src . os/.Getenvscip-go gomod github.com/golang/go/src . os/Getenv().("SHOUTRRR_NTFY_USERNAME") |
| 33 | password := osscip-go gomod github.com/golang/go/src . os/.Getenvscip-go gomod github.com/golang/go/src . os/Getenv().("SHOUTRRR_NTFY_PASSWORD") |
| 34 | |
| 35 | if username != "" { |
| 36 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..Usernamescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#Username.).Toscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#To().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Equalscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Equal().(username)) |
| 37 | } |
| 38 | |
| 39 | if password != "" { |
| 40 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..Passwordscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#Password.).Toscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#To().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Equalscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Equal().(password)) |
| 41 | } |
| 42 | }) |
| 43 | |
| 44 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Itscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/It().("should initialize with DisableTLS when configured", func() { |
| 45 | previous, hadPrevious := osscip-go gomod github.com/golang/go/src . os/.LookupEnvscip-go gomod github.com/golang/go/src . os/LookupEnv().("SHOUTRRR_NTFY_DISABLE_TLS") |
| 46 | _ = osscip-go gomod github.com/golang/go/src . os/.Setenvscip-go gomod github.com/golang/go/src . os/Setenv().("SHOUTRRR_NTFY_DISABLE_TLS", "true") |
| 47 | |
| 48 | defer func() { |
| 49 | if hadPrevious { |
| 50 | _ = osscip-go gomod github.com/golang/go/src . os/.Setenvscip-go gomod github.com/golang/go/src . os/Setenv().("SHOUTRRR_NTFY_DISABLE_TLS", previous) |
| 51 | } else { |
| 52 | _ = osscip-go gomod github.com/golang/go/src . os/.Unsetenvscip-go gomod github.com/golang/go/src . os/Unsetenv().("SHOUTRRR_NTFY_DISABLE_TLS") |
| 53 | } |
| 54 | }() |
| 55 | |
| 56 | serviceURLStr := buildServiceURLscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/buildServiceURL().() |
| 57 | service := initializeServicescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/initializeService().(serviceURLStr) |
| 58 | |
| 59 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..DisableTLSscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#DisableTLS.).Toscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#To().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.BeTruescip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/BeTrue().()) |
| 60 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..Schemescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#Scheme.).Toscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#To().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Equalscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Equal().("http")) |
| 61 | }) |
| 62 | |
| 63 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Itscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/It().("should initialize with priority from URL", func() { |
| 64 | serviceURLStr := addQueryParamscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/addQueryParam().(buildServiceURLscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/buildServiceURL().(), "priority", "Max") |
| 65 | service := initializeServicescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/initializeService().(serviceURLStr) |
| 66 | |
| 67 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..Priorityscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#Priority..Stringscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/priority#String().()).Toscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#To().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Equalscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Equal().("Max")) |
| 68 | }) |
| 69 | |
| 70 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Itscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/It().("should initialize with markdown enabled from URL", func() { |
| 71 | serviceURLStr := addQueryParamscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/addQueryParam().(buildServiceURLscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/buildServiceURL().(), "markdown", "yes") |
| 72 | service := initializeServicescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/initializeService().(serviceURLStr) |
| 73 | |
| 74 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..Markdownscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#Markdown.).Toscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#To().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.BeTruescip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/BeTrue().()) |
| 75 | }) |
| 76 | |
| 77 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Itscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/It().("should initialize with tags from URL", func() { |
| 78 | serviceURLStr := addQueryParamscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/addQueryParam().(buildServiceURLscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/buildServiceURL().(), "tags", "warning,skull") |
| 79 | service := initializeServicescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/initializeService().(serviceURLStr) |
| 80 | |
| 81 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..Tagsscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#Tags.).Toscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#To().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.ConsistOfscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/ConsistOf().("warning", "skull")) |
| 82 | }) |
| 83 | |
| 84 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Itscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/It().("should initialize with title from URL", func() { |
| 85 | serviceURLStr := addQueryParamscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/addQueryParam().(buildServiceURLscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/buildServiceURL().(), "title", "MyTitle") |
| 86 | service := initializeServicescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/testing/e2e/ntfy_test`/initializeService().(serviceURLStr) |
| 87 | |
| 88 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.Configscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#Config..Titlescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Config#Title.).Toscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#To().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Equalscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Equal().("MyTitle")) |
| 89 | }) |
| 90 | }) |
| 91 | |
| 92 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Whenscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/When().("no server is configured", func() { |
| 93 | ginkgoscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/.Itscip-go gomod github.com/onsi/ginkgo/v2 v2.32.1 `github.com/onsi/ginkgo/v2`/It().("should return the correct service ID", func() { |
| 94 | service := &ntfyscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/.Servicescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#{} |
| 95 | gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Expectscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Expect().(service.GetIDscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/ntfy`/Service#GetID().()).Toscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega/types`/Assertion#To().(gomegascip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/.Equalscip-go gomod github.com/onsi/gomega v1.42.1 `github.com/onsi/gomega`/Equal().("ntfy")) |
| 96 | }) |
| 97 | }) |
| 98 | }) |