### Question:
EclairFailureAnalyzer extends AbstractFailureAnalyzer<AnnotationUsageException> { String buildDescription(AnnotationUsageException cause) { StringBuilder builder = new StringBuilder(cause.getMessage() + "\n - method: " + cause.getMethod()); Annotation annotation = cause.getAnnotation(); if (nonNull(annotation)) { builder.append("\n - annotation: ").append(annotation); } return builder.toString(); }    }### Answer:
@Test public void buildDescription() throws NoSuchMethodException { Annotation annotation = synthesizeAnnotation(Autowired.class); AnnotationUsageException exception = new AnnotationUsageException(method, message, action, annotation); String description = eclairFailureAnalyzer.buildDescription(exception); String expected = "message\n" + " - method: public void ru.tinkoff.eclair.autoconfigure.EclairFailureAnalyzerTest.method()\n" + " - annotation: @org.springframework.beans.factory.annotation.Autowired(required=true)"; assertThat(description, is(expected)); }
@Test public void buildDescriptionWithoutAnnotation() throws NoSuchMethodException { AnnotationUsageException exception = new AnnotationUsageException(method, message, action); String description = eclairFailureAnalyzer.buildDescription(exception); String expected = "message\n" + " - method: public void ru.tinkoff.eclair.autoconfigure.EclairFailureAnalyzerTest.method()"; assertThat(description, is(expected)); }