[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
|
||||
*/
|
||||
protected WiserAssertions getAssertions() {
|
||||
protected WiserAssertions assertReceivedMessage() {
|
||||
return WiserAssertions.assertReceivedMessage(wiser);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public class Issue1Test extends AbstractWiserTest {
|
|||
//when
|
||||
mailer.sendMail(email);
|
||||
//then
|
||||
getAssertions().withContentContains("Hi Carl");
|
||||
assertReceivedMessage().withContentContains("Hi Carl");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class Issue6Test extends AbstractWiserTest {
|
|||
//when
|
||||
sender.send(message);
|
||||
//then
|
||||
getAssertions().from("bob@a.com").to("carl@b.com")
|
||||
assertReceivedMessage().from("bob@a.com").to("carl@b.com")
|
||||
.withSubject("Subject")
|
||||
.withContentContains("Hi Carl");
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue