@Test public void authLoginStartFailTest(TestContext testContext) { this.testContext=testContext; smtpServer.setDialogue("220 example.com ESMTP", "EHLO", "250-example.com\n" + "250 AUTH LOGIN", "AUTH LOGIN", "555 login is not possible due to some error"); testException(mailClientLogin()); }
@Test public void authJunkTest(TestContext testContext) { this.testContext=testContext; smtpServer.setDialogue("220 example.com ESMTP", "EHLO", "250-example.com\n" + "250 AUTH JUNK"); testException(mailClientLogin()); }
@Test public void authCramMD5FailTest(TestContext testContext) { this.testContext=testContext; smtpServer.setDialogue("220 example.com ESMTP", "EHLO", "250-example.com\n" + "250 AUTH CRAM-MD5", "AUTH CRAM-MD5", "334 PDEyMzQuYWJjZEBleGFtcGxlLmNvbT4=", "eHh4IDE2ZGEzMGQ5NmEwNTY4NWQ0MmQ4YzM5ZDlkMDgxOGIx", "435 4.7.8 Error: authentication failed: bad protocol / cancel"); testException(mailClientLogin()); }
@Test public void authPlainFailTest(TestContext testContext) { this.testContext=testContext; smtpServer.setDialogue("220 example.com ESMTP", "EHLO", "250-example.com\n" + "250 AUTH PLAIN", "AUTH PLAIN AHh4eAB5eXk=", "435 4.7.8 Error: authentication failed: bad protocol / cancel"); testException(mailClientLogin()); }
@Test public void authCramMD5StartFailTest(TestContext testContext) { this.testContext=testContext; smtpServer.setDialogue("220 example.com ESMTP", "EHLO", "250-example.com\n" + "250 AUTH CRAM-MD5", "AUTH CRAM-MD5", "555 login is not possible due to some error"); testException(mailClientLogin()); }
@Test public void authLoginUsernameFailTest(TestContext testContext) { this.testContext=testContext; smtpServer.setDialogue("220 example.com ESMTP", "EHLO", "250-example.com\n" + "250 AUTH LOGIN", "AUTH LOGIN", "334 VXNlcm5hbWU6", "eHh4", "555 login is not possible due to some error"); testException(mailClientLogin()); }
@Test public void authLoginFailTest(TestContext testContext) { this.testContext=testContext; smtpServer.setDialogue("220 example.com ESMTP", "EHLO", "250-example.com\n" + "250 AUTH LOGIN", "AUTH LOGIN", "334 VXNlcm5hbWU6", "eHh4", "334 UGFzc3dvcmQ6", "eXl5", "435 4.7.8 Error: authentication failed: authentication failure"); testException(mailClientLogin()); }
/** * test we have Login REQUIRED but no login data in the config */ @Test public void authAuthDataMissingTest(TestContext testContext) { this.testContext=testContext; smtpServer.setDialogue("220 example.com ESMTP", "EHLO", "250-example.com\n" + "250 AUTH PLAIN"); testException(MailClient.createNonShared(vertx, defaultConfig().setLogin(LoginOption.REQUIRED))); }
@Test public void authSelectMethodsNoneTest(TestContext testContext) { this.testContext=testContext; smtpServer.setDialogue("220 example.com ESMTP", "EHLO", "250-example.com\n" + "250 AUTH PLAIN LOGIN"); testException(MailClient.createNonShared(vertx, configLogin().setAuthMethods("DIGEST-MD5 CRAM-MD5"))); }