[testing] Rename getAssertions() as assertReceivedMessage()
Commands read more like the assertions they are.
This commit is contained in:
parent
e8e72adfdf
commit
1d43956263
4 changed files with 18 additions and 18 deletions
|
@ -41,7 +41,7 @@ abstract class AbstractWiserTest {
|
||||||
*
|
*
|
||||||
* @return the wiser assertions
|
* @return the wiser assertions
|
||||||
*/
|
*/
|
||||||
protected WiserAssertions getAssertions() {
|
protected WiserAssertions assertReceivedMessage() {
|
||||||
return WiserAssertions.assertReceivedMessage(wiser);
|
return WiserAssertions.assertReceivedMessage(wiser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class Issue1Test extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
mailer.sendMail(email);
|
mailer.sendMail(email);
|
||||||
//then
|
//then
|
||||||
getAssertions().withContentContains("Hi Carl");
|
assertReceivedMessage().withContentContains("Hi Carl");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,9 +30,9 @@ public class Issue6Test extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sender.send(message);
|
sender.send(message);
|
||||||
//then
|
//then
|
||||||
getAssertions().from("bob@a.com").to("carl@b.com")
|
assertReceivedMessage().from("bob@a.com").to("carl@b.com")
|
||||||
.withSubject("Subject")
|
.withSubject("Subject")
|
||||||
.withContentContains("Hi Carl");
|
.withContentContains("Hi Carl");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage("from", "to", "subject", body);
|
sendMimeMultipartMessage("from", "to", "subject", body);
|
||||||
//then
|
//then
|
||||||
getAssertions().withContent(body);
|
assertReceivedMessage().withContent(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,7 +82,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage("from", "to", "subject", body);
|
sendMimeMultipartMessage("from", "to", "subject", body);
|
||||||
//then
|
//then
|
||||||
getAssertions().withContent("Other body");
|
assertReceivedMessage().withContent("Other body");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,7 +96,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage("from", "to", "subject", body);
|
sendMimeMultipartMessage("from", "to", "subject", body);
|
||||||
//then
|
//then
|
||||||
getAssertions().withContentContains("age bo");
|
assertReceivedMessage().withContentContains("age bo");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -110,7 +110,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage("from", "to", "subject", body);
|
sendMimeMultipartMessage("from", "to", "subject", body);
|
||||||
//then
|
//then
|
||||||
getAssertions().withContentContains("agebo");
|
assertReceivedMessage().withContentContains("agebo");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,7 +126,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage(from, "to", "subject", "body");
|
sendMimeMultipartMessage(from, "to", "subject", "body");
|
||||||
//then
|
//then
|
||||||
getAssertions().from(from);
|
assertReceivedMessage().from(from);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -140,7 +140,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage(from, "to", "subject", "body");
|
sendMimeMultipartMessage(from, "to", "subject", "body");
|
||||||
//then
|
//then
|
||||||
getAssertions().from("lisa@c.com");
|
assertReceivedMessage().from("lisa@c.com");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -149,7 +149,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testInstantiate() {
|
public void testInstantiate() {
|
||||||
assertNotNull(getAssertions());
|
assertNotNull(assertReceivedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -164,7 +164,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
sendMimeMultipartMessage(
|
sendMimeMultipartMessage(
|
||||||
"from", "to", "subject " + fragment + " tail", "body");
|
"from", "to", "subject " + fragment + " tail", "body");
|
||||||
//then
|
//then
|
||||||
getAssertions().withSubjectContains(fragment);
|
assertReceivedMessage().withSubjectContains(fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -178,7 +178,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage("from", "to", "subject tail", "body");
|
sendMimeMultipartMessage("from", "to", "subject tail", "body");
|
||||||
//then
|
//then
|
||||||
getAssertions().withSubjectContains(fragment);
|
assertReceivedMessage().withSubjectContains(fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -192,7 +192,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage("from", "to", subject, "body");
|
sendMimeMultipartMessage("from", "to", subject, "body");
|
||||||
//then
|
//then
|
||||||
getAssertions().withSubject(subject);
|
assertReceivedMessage().withSubject(subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -206,7 +206,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage("from", "to", subject, "body");
|
sendMimeMultipartMessage("from", "to", subject, "body");
|
||||||
//then
|
//then
|
||||||
getAssertions().withSubject("other subject");
|
assertReceivedMessage().withSubject("other subject");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -220,7 +220,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage("from", to, "subject", "body");
|
sendMimeMultipartMessage("from", to, "subject", "body");
|
||||||
//then
|
//then
|
||||||
getAssertions().to(to);
|
assertReceivedMessage().to(to);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -235,7 +235,7 @@ public class WiserAssertionsTest extends AbstractWiserTest {
|
||||||
//when
|
//when
|
||||||
sendMimeMultipartMessage("from", to, "subject", "body");
|
sendMimeMultipartMessage("from", to, "subject", "body");
|
||||||
//then
|
//then
|
||||||
getAssertions().to("bob@a.com");
|
assertReceivedMessage().to("bob@a.com");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue