From 7db5ac81959905be0726ace48789a369d5d82e36 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 4 Sep 2024 12:23:52 +0200 Subject: [PATCH] Fix the test according to the behavior change. --- .../unifiedpush/DefaultUnifiedPushGatewayResolverTest.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/DefaultUnifiedPushGatewayResolverTest.kt b/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/DefaultUnifiedPushGatewayResolverTest.kt index cee74bfa31..00d397d421 100644 --- a/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/DefaultUnifiedPushGatewayResolverTest.kt +++ b/libraries/pushproviders/unifiedpush/src/test/kotlin/io/element/android/libraries/pushproviders/unifiedpush/DefaultUnifiedPushGatewayResolverTest.kt @@ -95,7 +95,7 @@ class DefaultUnifiedPushGatewayResolverTest { } @Test - fun `when a custom url is not reachable, the default url is returned`() = runTest { + fun `when a custom url is not reachable, the custom url is still returned`() = runTest { val unifiedPushApiFactory = FakeUnifiedPushApiFactory( discoveryResponse = { throw AN_EXCEPTION } ) @@ -104,7 +104,7 @@ class DefaultUnifiedPushGatewayResolverTest { ) val result = sut.getGateway("http://custom.url") assertThat(unifiedPushApiFactory.baseUrlParameter).isEqualTo("http://custom.url") - assertThat(result).isEqualTo(UnifiedPushConfig.DEFAULT_PUSH_GATEWAY_HTTP_URL) + assertThat(result).isEqualTo("http://custom.url/_matrix/push/v1/notify") } @Test @@ -121,7 +121,7 @@ class DefaultUnifiedPushGatewayResolverTest { } @Test - fun `when a custom url provides a invalid matrix gateway, the default url is returned`() = runTest { + fun `when a custom url provides a invalid matrix gateway, the custom url is still returned`() = runTest { val unifiedPushApiFactory = FakeUnifiedPushApiFactory( discoveryResponse = invalidDiscoveryResponse ) @@ -130,7 +130,7 @@ class DefaultUnifiedPushGatewayResolverTest { ) val result = sut.getGateway("https://custom.url") assertThat(unifiedPushApiFactory.baseUrlParameter).isEqualTo("https://custom.url") - assertThat(result).isEqualTo(UnifiedPushConfig.DEFAULT_PUSH_GATEWAY_HTTP_URL) + assertThat(result).isEqualTo("https://custom.url/_matrix/push/v1/notify") } private fun TestScope.createDefaultUnifiedPushGatewayResolver(