From 1d439562630b8162410113543d0ef6e134c92609 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 25 Aug 2018 08:34:03 +0100 Subject: [PATCH] [testing] Rename getAssertions() as assertReceivedMessage() Commands read more like the assertions they are. --- .../wiser/assertions/AbstractWiserTest.java | 2 +- .../kemitix/wiser/assertions/Issue1Test.java | 2 +- .../kemitix/wiser/assertions/Issue6Test.java | 6 ++--- .../wiser/assertions/WiserAssertionsTest.java | 26 +++++++++---------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/test/java/net/kemitix/wiser/assertions/AbstractWiserTest.java b/src/test/java/net/kemitix/wiser/assertions/AbstractWiserTest.java index 7f7121f..2eb8437 100644 --- a/src/test/java/net/kemitix/wiser/assertions/AbstractWiserTest.java +++ b/src/test/java/net/kemitix/wiser/assertions/AbstractWiserTest.java @@ -41,7 +41,7 @@ abstract class AbstractWiserTest { * * @return the wiser assertions */ - protected WiserAssertions getAssertions() { + protected WiserAssertions assertReceivedMessage() { return WiserAssertions.assertReceivedMessage(wiser); } diff --git a/src/test/java/net/kemitix/wiser/assertions/Issue1Test.java b/src/test/java/net/kemitix/wiser/assertions/Issue1Test.java index 80a5663..d8d1fe7 100644 --- a/src/test/java/net/kemitix/wiser/assertions/Issue1Test.java +++ b/src/test/java/net/kemitix/wiser/assertions/Issue1Test.java @@ -31,7 +31,7 @@ public class Issue1Test extends AbstractWiserTest { //when mailer.sendMail(email); //then - getAssertions().withContentContains("Hi Carl"); + assertReceivedMessage().withContentContains("Hi Carl"); } } diff --git a/src/test/java/net/kemitix/wiser/assertions/Issue6Test.java b/src/test/java/net/kemitix/wiser/assertions/Issue6Test.java index 61ae67c..2ec4535 100644 --- a/src/test/java/net/kemitix/wiser/assertions/Issue6Test.java +++ b/src/test/java/net/kemitix/wiser/assertions/Issue6Test.java @@ -30,9 +30,9 @@ public class Issue6Test extends AbstractWiserTest { //when sender.send(message); //then - getAssertions().from("bob@a.com").to("carl@b.com") - .withSubject("Subject") - .withContentContains("Hi Carl"); + assertReceivedMessage().from("bob@a.com").to("carl@b.com") + .withSubject("Subject") + .withContentContains("Hi Carl"); } } diff --git a/src/test/java/net/kemitix/wiser/assertions/WiserAssertionsTest.java b/src/test/java/net/kemitix/wiser/assertions/WiserAssertionsTest.java index 0928425..9eb2645 100644 --- a/src/test/java/net/kemitix/wiser/assertions/WiserAssertionsTest.java +++ b/src/test/java/net/kemitix/wiser/assertions/WiserAssertionsTest.java @@ -68,7 +68,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage("from", "to", "subject", body); //then - getAssertions().withContent(body); + assertReceivedMessage().withContent(body); } /** @@ -82,7 +82,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage("from", "to", "subject", body); //then - getAssertions().withContent("Other body"); + assertReceivedMessage().withContent("Other body"); } /** @@ -96,7 +96,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage("from", "to", "subject", body); //then - getAssertions().withContentContains("age bo"); + assertReceivedMessage().withContentContains("age bo"); } /** @@ -110,7 +110,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage("from", "to", "subject", body); //then - getAssertions().withContentContains("agebo"); + assertReceivedMessage().withContentContains("agebo"); } /** @@ -126,7 +126,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage(from, "to", "subject", "body"); //then - getAssertions().from(from); + assertReceivedMessage().from(from); } /** @@ -140,7 +140,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage(from, "to", "subject", "body"); //then - getAssertions().from("lisa@c.com"); + assertReceivedMessage().from("lisa@c.com"); } /** @@ -149,7 +149,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { */ @Test public void testInstantiate() { - assertNotNull(getAssertions()); + assertNotNull(assertReceivedMessage()); } /** @@ -164,7 +164,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { sendMimeMultipartMessage( "from", "to", "subject " + fragment + " tail", "body"); //then - getAssertions().withSubjectContains(fragment); + assertReceivedMessage().withSubjectContains(fragment); } /** @@ -178,7 +178,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage("from", "to", "subject tail", "body"); //then - getAssertions().withSubjectContains(fragment); + assertReceivedMessage().withSubjectContains(fragment); } /** @@ -192,7 +192,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage("from", "to", subject, "body"); //then - getAssertions().withSubject(subject); + assertReceivedMessage().withSubject(subject); } /** @@ -206,7 +206,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage("from", "to", subject, "body"); //then - getAssertions().withSubject("other subject"); + assertReceivedMessage().withSubject("other subject"); } /** @@ -220,7 +220,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage("from", to, "subject", "body"); //then - getAssertions().to(to); + assertReceivedMessage().to(to); } /** @@ -235,7 +235,7 @@ public class WiserAssertionsTest extends AbstractWiserTest { //when sendMimeMultipartMessage("from", to, "subject", "body"); //then - getAssertions().to("bob@a.com"); + assertReceivedMessage().to("bob@a.com"); } }