@Test public void encodingShouldWellFormWhenNilReturnedAnnotation() throws Exception { AnnotationResponse response = new AnnotationResponse("INBOX", ImmutableList.of(MailboxAnnotation.nil(PRIVATE_KEY))); encoder.encode(response, composer); assertThat(byteImapResponseWriter.getString()).isEqualTo("* METADATA \"INBOX\" ()\r\n"); }
@Override public void encode(AnnotationResponse response, ImapResponseComposer composer) throws IOException { composer.untagged(); composer.message(ImapConstants.ANNOTATION_RESPONSE_NAME); composer.quote(Optional.ofNullable(response.getMailboxName()).orElse("")); composeAnnotations(composer, response.getMailboxAnnotations()); composer.end(); }
AnnotationResponseEncoder implements ImapResponseEncoder<AnnotationResponse> { @Override public void encode(AnnotationResponse response, ImapResponseComposer composer) throws IOException { composer.untagged(); composer.message(ImapConstants.ANNOTATION_RESPONSE_NAME); composer.quote(Optional.ofNullable(response.getMailboxName()).orElse("")); composeAnnotations(composer, response.getMailboxAnnotations()); composer.end(); } }
AnnotationResponseEncoder implements ImapResponseEncoder<AnnotationResponse> { @Override public void encode(AnnotationResponse response, ImapResponseComposer composer) throws IOException { composer.untagged(); composer.message(ImapConstants.ANNOTATION_RESPONSE_NAME); composer.quote(Optional.ofNullable(response.getMailboxName()).orElse("")); composeAnnotations(composer, response.getMailboxAnnotations()); composer.end(); }  }
AnnotationResponseEncoder implements ImapResponseEncoder<AnnotationResponse> { @Override public void encode(AnnotationResponse response, ImapResponseComposer composer) throws IOException { composer.untagged(); composer.message(ImapConstants.ANNOTATION_RESPONSE_NAME); composer.quote(Optional.ofNullable(response.getMailboxName()).orElse("")); composeAnnotations(composer, response.getMailboxAnnotations()); composer.end(); }  @Override Class<AnnotationResponse> acceptableMessages(); @Override void encode(AnnotationResponse response, ImapResponseComposer composer); }
AnnotationResponseEncoder implements ImapResponseEncoder<AnnotationResponse> { @Override public void encode(AnnotationResponse response, ImapResponseComposer composer) throws IOException { composer.untagged(); composer.message(ImapConstants.ANNOTATION_RESPONSE_NAME); composer.quote(Optional.ofNullable(response.getMailboxName()).orElse("")); composeAnnotations(composer, response.getMailboxAnnotations()); composer.end(); }  @Override Class<AnnotationResponse> acceptableMessages(); @Override void encode(AnnotationResponse response, ImapResponseComposer composer);  }