From fd0328a58bccab77bd86f9ffefea720068c3d034 Mon Sep 17 00:00:00 2001 From: To-om Date: Fri, 29 May 2020 14:23:21 +0200 Subject: [PATCH] #1374 Add tests with dashes --- .../thp/thehive/migration/th3/UserNormalisationTest.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migration/src/test/scala/org/thp/thehive/migration/th3/UserNormalisationTest.scala b/migration/src/test/scala/org/thp/thehive/migration/th3/UserNormalisationTest.scala index 9905d738be..679bf1b7a8 100644 --- a/migration/src/test/scala/org/thp/thehive/migration/th3/UserNormalisationTest.scala +++ b/migration/src/test/scala/org/thp/thehive/migration/th3/UserNormalisationTest.scala @@ -13,6 +13,9 @@ class UserNormalisationTest extends PlaySpecification with Conversion { "convert simple name" in { normaliseLogin("myLogin") must beEqualTo("mylogin@thehive.local") } + "convert simple name with dash" in { + normaliseLogin("my-Login") must beEqualTo("my-login@thehive.local") + } "convert email address" in { normaliseLogin("Firstname.Lastname@Example.com") must beEqualTo("firstname.lastname@example.com") } @@ -34,5 +37,8 @@ class UserNormalisationTest extends PlaySpecification with Conversion { "convert email with invalid domain" in { normaliseLogin("first@```") must beEqualTo("first@thehive.local") } + "convert email with dash" in { + normaliseLogin("-first-name-@-domain-name-") must beEqualTo("first-name@domain-name") + } } }