[testing] Rename getAssertions() as assertReceivedMessage()

Commands read more like the assertions they are.
This commit is contained in:
Paul Campbell 2018-08-25 08:34:03 +01:00
parent e8e72adfdf
commit 1d43956263
4 changed files with 18 additions and 18 deletions

View file

@ -41,7 +41,7 @@ abstract class AbstractWiserTest {
*
* @return the wiser assertions
*/
protected WiserAssertions getAssertions() {
protected WiserAssertions assertReceivedMessage() {
return WiserAssertions.assertReceivedMessage(wiser);
}

View file

@ -31,7 +31,7 @@ public class Issue1Test extends AbstractWiserTest {
//when
mailer.sendMail(email);
//then
getAssertions().withContentContains("Hi Carl");
assertReceivedMessage().withContentContains("Hi Carl");
}
}

View file

@ -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");
}
}

View file

@ -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");
}
}