#180: fix tests for travis

This commit is contained in:
Benjamin Gamard 2018-02-27 15:34:20 +01:00
parent 3720a881a4
commit 1054931e63
1 changed files with 6 additions and 4 deletions

View File

@ -256,7 +256,7 @@ public class TestAppResource extends BaseJerseyTest {
.post(Entity.form(new Form()
.param("enabled", "true")
.param("hostname", "localhost")
.param("port", "143")
.param("port", "9755")
.param("username", "test@sismics.com")
.param("password", "12345678")
.param("tag", tagInboxId)
@ -268,12 +268,14 @@ public class TestAppResource extends BaseJerseyTest {
.get(JsonObject.class);
Assert.assertTrue(json.getBoolean("enabled"));
Assert.assertEquals("localhost", json.getString("hostname"));
Assert.assertEquals(143, json.getInt("port"));
Assert.assertEquals(9755, json.getInt("port"));
Assert.assertEquals("test@sismics.com", json.getString("username"));
Assert.assertEquals("12345678", json.getString("password"));
Assert.assertEquals(tagInboxId, json.getString("tag"));
GreenMail greenMail = new GreenMail(new ServerSetup[] { ServerSetup.SMTP, ServerSetup.IMAP });
ServerSetup serverSetupSmtp = new ServerSetup(9754, null, ServerSetup.PROTOCOL_SMTP);
ServerSetup serverSetupImap = new ServerSetup(9755, null, ServerSetup.PROTOCOL_IMAP);
GreenMail greenMail = new GreenMail(new ServerSetup[] { serverSetupSmtp, serverSetupImap });
greenMail.setUser("test@sismics.com", "12345678");
greenMail.start();
@ -284,7 +286,7 @@ public class TestAppResource extends BaseJerseyTest {
Assert.assertEquals(0, json.getJsonNumber("count").intValue());
// Send an email
GreenMailUtil.sendTextEmail("test@sismics.com", "test@sismicsdocs.com", "Test email 1", "Test content 1", ServerSetup.SMTP);
GreenMailUtil.sendTextEmail("test@sismics.com", "test@sismicsdocs.com", "Test email 1", "Test content 1", serverSetupSmtp);
// Trigger an inbox sync
AppContext.getInstance().getInboxService().syncInbox();