@Test
public void testInterfaceGenerator() throws Exception {

    InterfacesGenerator interfacesGenerator =
            (InterfacesGenerator) context.getBean("interfacesGenerator");
    assertNotNull("No interfaces generator", interfacesGenerator);
    try {
        interfacesGenerator.generateSource();
    } catch (Exception ex) {
        ex.printStackTrace();
        throw ex;
    }
    Path p = Paths.get(GENERATED_SOURCE_DIR);
    assertNotNull("Could not locate generated source path", p);
    int maxDepth = 10;
    List<String> fileNames = new ArrayList<>();
    Files.find(p, maxDepth, (path, basicFileAttributes) -> String.valueOf(path).endsWith(".java"))
            .map(path -> path.getFileName().toString()).forEach(fileNames::add);
    assertEquals("Incorrect number of files generated. Expected 4 was " + fileNames.size(), 4, fileNames.size());
}