-
-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Setting test frontend URL globally (#2890)
- Loading branch information
Showing
8 changed files
with
21 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,6 @@ class MarketingEmailingTest : AuthorizedControllerTest() { | |
@BeforeEach | ||
fun setup() { | ||
Mockito.clearInvocations(mailjetEmailServiceManager) | ||
tolgeeProperties.frontEndUrl = "https://aaa" | ||
tolgeeProperties.smtp.from = "[email protected]" | ||
emailTestUtil.initMocks() | ||
} | ||
|
@@ -82,7 +81,6 @@ class MarketingEmailingTest : AuthorizedControllerTest() { | |
fun cleanUp() { | ||
sendInBlueProperties.listId = null | ||
tolgeeProperties.authentication.needsEmailVerification = false | ||
tolgeeProperties.frontEndUrl = null | ||
} | ||
|
||
private val testMail = "[email protected]" | ||
|
@@ -98,7 +96,6 @@ class MarketingEmailingTest : AuthorizedControllerTest() { | |
|
||
@Test | ||
fun `adds contact after verification when needs-verification is on`() { | ||
tolgeeProperties.frontEndUrl = "https://aaa" | ||
tolgeeProperties.authentication.needsEmailVerification = true | ||
val dto = SignUpDto(name = testName, password = "aaaaaaaaaa", email = testMail) | ||
performPost("/api/public/sign_up", dto) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,11 @@ class EmailVerificationTest : AbstractControllerTest() { | |
@Autowired | ||
override lateinit var tolgeeProperties: TolgeeProperties | ||
|
||
private var defaultFrontendUrl: String? = null | ||
|
||
@BeforeEach | ||
fun setup() { | ||
defaultFrontendUrl = tolgeeProperties.frontEndUrl | ||
resetProperties() | ||
tolgeeProperties.authentication.needsEmailVerification = true | ||
emailTestUtil.initMocks() | ||
|
@@ -38,7 +41,7 @@ class EmailVerificationTest : AbstractControllerTest() { | |
|
||
private fun resetProperties() { | ||
tolgeeProperties.authentication.needsEmailVerification = false | ||
tolgeeProperties.frontEndUrl = "dummy_frontend_url" | ||
tolgeeProperties.frontEndUrl = defaultFrontendUrl | ||
tolgeeProperties.smtp.from = "[email protected]" | ||
} | ||
|
||
|
@@ -120,7 +123,7 @@ class EmailVerificationTest : AbstractControllerTest() { | |
|
||
assertThat(emailTestUtil.messageArgumentCaptor.firstValue.subject).isEqualTo("Tolgee e-mail verification") | ||
|
||
assertThat(getMessageContent()).contains("dummy_frontend_url/login/verify_email/${user.id}/") | ||
assertThat(getMessageContent()).contains("https://dummy-url.com/login/verify_email/${user.id}/") | ||
|
||
assertThat(userAccountService.findActive(user.id)).isNotNull | ||
} | ||
|
@@ -131,7 +134,7 @@ class EmailVerificationTest : AbstractControllerTest() { | |
perform() | ||
val user = userAccountService.findActive(signUpDto.email) ?: throw NotFoundException() | ||
|
||
assertThat(getMessageContent()).contains("dummy_frontend_url/login/verify_email/${user.id}/") | ||
assertThat(getMessageContent()).contains("https://dummy-url.com/login/verify_email/${user.id}/") | ||
|
||
assertThat(userAccountService.findActive(user.id)).isNotNull | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,3 +83,4 @@ tolgee: | |
server: http://localhost:8080 | ||
batch: | ||
concurrency: 10 | ||
front-end-url: https://dummy-url.com |