mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 21:25:38 +00:00
also add mail replication test that tests outside of SecurityService context
This commit is contained in:
@@ -6,6 +6,8 @@ Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: SAP
|
||||
Fragment-Host: com.sap.sse.mail
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.junit4;bundle-version="4.8.2",
|
||||
Require-Bundle: org.hamcrest;bundle-version="1.1.0",
|
||||
org.junit4;bundle-version="4.8.2",
|
||||
com.rabbitmq.client,
|
||||
com.sap.sse.replication.testsupport
|
||||
com.sap.sse.replication.testsupport,
|
||||
com.sap.sse.mail.replication.testsupport
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.sap.sse.mail.replication.test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sse.common.mail.MailException;
|
||||
import com.sap.sse.mail.MailService;
|
||||
import com.sap.sse.mail.replication.testsupport.AbstractMailServiceReplicationTest;
|
||||
|
||||
public class SimpleMailServiceReplicationTest extends AbstractMailServiceReplicationTest {
|
||||
@Test
|
||||
public void testReplicationOfSendMail() throws InterruptedException,
|
||||
IllegalAccessException, MailException {
|
||||
MailService master = testSetUp.getMaster();
|
||||
MailService replica = testSetUp.getReplica();
|
||||
master.sendMail("test@ing.me", "oh what a beatiful mail", "to be sent on this day");
|
||||
|
||||
testSetUp.getReplicaReplicator().waitUntilQueueIsEmpty();
|
||||
Thread.sleep(3000);
|
||||
|
||||
assertThat("mail was not sent on replica",
|
||||
AbstractMailServiceReplicationTest.numberOfMailsSent.get(replica), equalTo(null));
|
||||
assertThat("mail was sent on master",
|
||||
AbstractMailServiceReplicationTest.numberOfMailsSent.get(master), equalTo(1));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user