private static void assertApplication(File application) throws IOException {
        assertTrue(application.isDirectory());
        String applicationName = application.getName();
        Map<String, File> files = new HashMap<>();
        for (File file : application.listFiles(new ContentFilter())) {
            files.put(file.getName(), file);
        }
        String path = null;
        try {
            path = application.getCanonicalPath();
        } catch (IOException e) {
            fail("Could not resolve path for application '" + applicationName + "'.");
        }
        VespaModelCreatorWithFilePkg creator = new VespaModelCreatorWithFilePkg(path);

        VespaModel model = creator.create();
        List<String> errors = model.getRouting().getErrors();
        if (errors.isEmpty()) {
            if (files.containsKey("errors.txt")) {
                if (WRITE_FILES) {
                    files.remove("errors.txt").delete();
                } else {
                    fail("Route verification did not fail.");
                }
            }
            MessagebusConfig.Builder mBusB = new MessagebusConfig.Builder();
            model.getConfig(mBusB, "");
            MessagebusConfig mBus = new MessagebusConfig(mBusB);
            assertConfigFileContains(application, files, "messagebus.cfg", mBus);

            DocumentrouteselectorpolicyConfig.Builder drB = new DocumentrouteselectorpolicyConfig.Builder();
            model.getConfig(drB, "");
            DocumentrouteselectorpolicyConfig dr = new DocumentrouteselectorpolicyConfig(drB);
            assertConfigFileContains(application, files, "documentrouteselectorpolicy.cfg", dr);

            DocumentProtocolPoliciesConfig.Builder policies = new DocumentProtocolPoliciesConfig.Builder();
            model.getConfig(policies, "");
            assertConfigFileContains(application, files, "document-protocol-policies.cfg", policies.build());
        } else {
            StringBuilder msg = new StringBuilder();
            for (String error : errors) {
                msg.append(error).append("\n");
            }
            assertFileContains(application, files, "errors.txt", msg.toString());
        }
    }
Tests whether or not the given application produces the expected output. When creating new tests, create an
application directory containing the necessary setup files, and call this method with a TRUE create flag.

@param application The application directory.
config-model/src/test/java/com/yahoo/vespa/model/routing/test/RoutingTestCase.java