@Test
  public void providedButNoAutoFactory() {
    JavaFileObject file = JavaFileObjects.forResource("bad/ProvidedButNoAutoFactory.java");
    Compilation compilation = javac.compile(file);
    assertThat(compilation).failed();
    assertThat(compilation)
        .hadErrorContaining(
            "@Provided may only be applied to constructors requesting an auto-factory")
        .inFile(file)
        .onLineContaining("@Provided");
  }
Testing compilation errors from {@link AutoFactoryProcessor}.
factory/src/test/java/com/google/auto/factory/processor/AutoFactoryProcessorNegativeTest.java