DAFileWriter implements DAWriter { public DAFileWriter appendGeneratedAnnotation(@Nonnull Class<? extends Processor> processClass) throws IOException { return appendGeneratedAnnotation(processClass.getCanonicalName()); } DAFileWriter(BufferedWriter writer); DAFileWriter appendPackage(@Nonnull DAName packageName); DAFileWriter appendImports(@Nonnull Collection<DAImport> mapperImports); DAFileWriter appendGeneratedAnnotation(@Nonnull Class<? extends Processor> processClass); DAFileWriter appendGeneratedAnnotation(@Nonnull String annotationProcessorQualifiedName); DAClassWriter<DAFileWriter> newClass(DAType classType); DAInterfaceWriter<DAFileWriter> newInterface(String name); void end();  }
@Test public void appendGeneratedAnnotation_from_String_adds_generated_annotation_and_newLine() throws Exception { FileContextTestImpl fileContext = new FileContextTestImpl(); new DAFileWriter(fileContext.getWriter()).appendGeneratedAnnotation(MyProcessor.class.getCanonicalName()); assertThat(fileContext.getRes()).isEqualTo( "@javax.annotation.Generated(\"" + MyProcessor.class.getCanonicalName() + "\")" + LINE_SEPARATOR ); }
@Test public void appendGeneratedAnnotation_from_Class_adds_generated_annotation_with_class_qualifiedName_and_newLine() throws Exception { FileContextTestImpl fileContext = new FileContextTestImpl(); new DAFileWriter(fileContext.getWriter()).appendGeneratedAnnotation(MyProcessor.class); assertThat(fileContext.getRes()).isEqualTo( "@javax.annotation.Generated(\"" + MyProcessor.class.getCanonicalName() + "\")" + LINE_SEPARATOR ); }