From 02b5da7043c78f40a58647c746f6bb316ea2d3d4 Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Fri, 17 Nov 2023 12:47:36 +0100 Subject: [PATCH] Fixed tests --- server/src/test/java/access/cron/IdentityProviderTest.java | 2 ++ .../src/test/java/access/cron/RoleExpirationNotifierTest.java | 1 + 2 files changed, 3 insertions(+) diff --git a/server/src/test/java/access/cron/IdentityProviderTest.java b/server/src/test/java/access/cron/IdentityProviderTest.java index ab32f385..3f916e3e 100644 --- a/server/src/test/java/access/cron/IdentityProviderTest.java +++ b/server/src/test/java/access/cron/IdentityProviderTest.java @@ -17,5 +17,7 @@ void getName() { LocaleContextHolder.setLocale(Locale.forLanguageTag("nl")); identityProvider = new IdentityProvider("en", "nl", "logo"); assertEquals("nl", identityProvider.getName()); + //Put back the locale, otherwise the mail tests become flakey + LocaleContextHolder.setLocale(Locale.ENGLISH); } } \ No newline at end of file diff --git a/server/src/test/java/access/cron/RoleExpirationNotifierTest.java b/server/src/test/java/access/cron/RoleExpirationNotifierTest.java index a0546fb8..e00f3496 100644 --- a/server/src/test/java/access/cron/RoleExpirationNotifierTest.java +++ b/server/src/test/java/access/cron/RoleExpirationNotifierTest.java @@ -29,6 +29,7 @@ void sweep() { MimeMessageParser messageParser = super.mailMessage(); String htmlContent = messageParser.getHtmlContent(); + System.out.println(htmlContent); assertTrue(htmlContent.contains("Your Inviter role Mail at the application Calendar EN will expire")); userRole = userRoleRepository.findByRoleName("Mail").get(0);