PageRenderTime 20ms CodeModel.GetById 10ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/sitebricks-mail/src/test/java/com/google/sitebricks/mail/ServerMessageMatchingTest.java

http://github.com/dhanji/sitebricks
Java | 23 lines | 14 code | 6 blank | 3 comment | 0 complexity | f1df019ee5f9d1dc17d7b2b267a61e1f MD5 | raw file
 1package com.google.sitebricks.mail;
 2
 3import org.testng.annotations.Test;
 4
 5import java.util.regex.Matcher;
 6
 7import static org.testng.Assert.assertEquals;
 8import static org.testng.Assert.assertTrue;
 9
10/**
11 * @author dhanji@gmail.com (Dhanji R. Prasanna)
12 */
13public class ServerMessageMatchingTest {
14
15  @Test
16  public final void authFailed() {
17    String failure = ". NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)";
18    Matcher matcher = MailClientHandler.COMMAND_FAILED_REGEX.matcher(failure);
19
20    assertTrue(matcher.find());
21    assertEquals(matcher.group(2), "[AUTHENTICATIONFAILED] Invalid credentials (Failure)");
22  }
23}