private ImapMessage unsupportedCharset(final String tag, final ImapCommand command) { final StatusResponseFactory factory = getStatusResponseFactory(); final ResponseCode badCharset = StatusResponse.ResponseCode.badCharset(CharsetUtil.getAvailableCharsetNames()); final StatusResponse result = factory.taggedNo(tag, command, HumanReadableText.BAD_CHARSET, badCharset); return result; }
private ImapMessage unsupportedCharset(String tag, ImapCommand command) { final StatusResponseFactory factory = getStatusResponseFactory(); final ResponseCode badCharset = StatusResponse.ResponseCode.badCharset(CharsetUtil.getAvailableCharsetNames()); return factory.taggedNo(tag, command, HumanReadableText.BAD_CHARSET, badCharset); }
@Test public void testBadCharset() throws Exception { ImapRequestLineReader reader = new ImapRequestStreamLineReader( new ByteArrayInputStream("CHARSET BOGUS ".getBytes("US-ASCII")), new ByteArrayOutputStream()); parser.decode(command, reader, TAG, false, session); verify(mockStatusResponseFactory, times(1)).taggedNo( eq(TAG), same(command), eq(HumanReadableText.BAD_CHARSET), eq(StatusResponse.ResponseCode.badCharset(CharsetUtil.getAvailableCharsetNames()))); verifyNoMoreInteractions(mockStatusResponseFactory); }
@Test public void testBadCharset() throws Exception { ImapRequestLineReader reader = new ImapRequestStreamLineReader( new ByteArrayInputStream("CHARSET BOGUS ".getBytes("US-ASCII")), new ByteArrayOutputStream()); parser.decode(command, reader, TAG, false, session); verify(mockStatusResponseFactory, times(1)).taggedNo( eq(TAG), same(command), eq(HumanReadableText.BAD_CHARSET), eq(StatusResponse.ResponseCode.badCharset(CharsetUtil.getAvailableCharsetNames()))); verifyNoMoreInteractions(mockStatusResponseFactory); }