1 19 20 package org.apache.james.imapserver.handler.commands; 21 22 import org.apache.james.imapserver.ImapSessionState; 23 import org.apache.james.imapserver.ProtocolException; 24 25 public class CreateCommandTest extends AbstractCommandTest { 26 27 public void testCreateNonFq() throws ProtocolException { 28 final String fqMailboxName = "#mock.user.Test"; 29 30 setSessionState(ImapSessionState.AUTHENTICATED); 31 setUpMailboxManager(); 32 33 mockSession.expects(once()).method("buildFullName").with(eq("Test")) 34 .will(returnValue(fqMailboxName)); 35 mockSession.expects(once()).method("unsolicitedResponses").withAnyArguments(); 36 37 mockMailboxManager.expects(once()).method("createMailbox").with( 38 eq(fqMailboxName)); 39 40 String response = handleRequest("1 CREATE Test\n"); 41 42 assertEquals("1 OK CREATE completed.\r\n", response); 43 } 44 45 } 46 | Popular Tags |