### Question:
RadlToSpringServer implements Application { void generate(File radlFile, File baseDir, String packagePrefix, String generatedSourceSetDir, String mainSourceSetDir, SourceCodeManagementSystem scm, String header) { File assembledRadl = RadlFileAssembler.assemble(radlFile, null); try { Document radlDocument = Xml.parse(assembledRadl); Desired<String, SourceFile> desired = new DesiredSourceFiles(radlDocument, new SpringSourceFilesGenerator(packagePrefix, generatedSourceSetDir, mainSourceSetDir, header), baseDir); Reality<String, SourceFile> reality = new RealSourceFiles(baseDir, generatedSourceSetDir, mainSourceSetDir, Java.packageToDir(packagePrefix), scm); new Enforcer<String, SourceFile>().enforce(desired, reality); } finally { IO.delete(assembledRadl); } }  static void main(String[] args); @Override int run(Arguments arguments);  }### Answer:
@Test public void generatesSpringServerSourceFilesFromRadl() throws IOException { String lower = "f"; String upper = lower.toUpperCase(Locale.getDefault()); String name = RANDOM.string(); Document radlDocument = RadlBuilder.aRadlDocument() .withResource() .named(lower + name) .end() .build(); try (PrintWriter writer = new PrintWriter(radlFile, "UTF8")) { writer.print(Xml.toString(radlDocument)); } String packagePrefix = somePackage(); String generatedSourceSetDir = someSourceSetDir(); String mainSourceSetDir = someSourceSetDir(); SourceCodeManagementSystem scm = mock(SourceCodeManagementSystem.class); String header = RANDOM.string(); generator.generate(radlFile, baseDir, packagePrefix, generatedSourceSetDir, mainSourceSetDir, scm, header); Collection<File> files = generatedFiles(); File controller = find(files, upper + name + "Controller.java"); assertNotNull("Missing controller: " + files, controller); String expectedPath = expectedFilePath(generatedSourceSetDir, packagePrefix, lower + name, controller); assertEquals("Controller path", expectedPath, controller.getAbsolutePath()); JavaCode javaCode = toJava(controller); TestUtil.assertCollectionEquals("Header for " + controller.getName(), Arrays.asList(header), javaCode.fileComments()); File controllerSupport = find(files, upper + name + "ControllerSupport.java"); assertNotNull("Missing controller support: " + files, controllerSupport); expectedPath = expectedFilePath(mainSourceSetDir, packagePrefix, lower + name, controllerSupport); assertEquals("Controller support path", expectedPath, controllerSupport.getAbsolutePath()); }