<commit_before>/* global describe, beforeEach, it */

const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');
const fse = require('fs-extra');
const constants = require('../generators/generator-constants');

const SERVER_MAIN_SRC_DIR = constants.SERVER_MAIN_SRC_DIR;
const SERVER_TEST_SRC_DIR = constants.SERVER_TEST_SRC_DIR;

describe('JHipster generator spring-controller', () => {
    describe('creates spring controller', () => {
        beforeEach((done) => {
            helpers.run(require.resolve('../generators/spring-controller'))
                .inTmpDir((dir) => {
                    fse.copySync(path.join(__dirname, '../test/templates/default'), dir);
                })
                .withArguments(['foo'])
                .withPrompts({
                    actionAdd: false
                })
                .on('end', done);
        });

        it('creates controller files', () => {
            assert.file([
                `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/FooController.java`
            ]);

            assert.file([
                `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/web/rest/FooControllerIntTest.java`
            ]);
        });
    });
});
<commit_msg>Fix Yeoman unit test<commit_after>/* global describe, beforeEach, it */

const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');
const fse = require('fs-extra');
const constants = require('../generators/generator-constants');

const SERVER_MAIN_SRC_DIR = constants.SERVER_MAIN_SRC_DIR;
const SERVER_TEST_SRC_DIR = constants.SERVER_TEST_SRC_DIR;

describe('JHipster generator spring-controller', () => {
    describe('creates spring controller', () => {
        beforeEach((done) => {
            helpers.run(require.resolve('../generators/spring-controller'))
                .inTmpDir((dir) => {
                    fse.copySync(path.join(__dirname, '../test/templates/default'), dir);
                })
                .withArguments(['foo'])
                .withPrompts({
                    actionAdd: false
                })
                .on('end', done);
        });

        it('creates controller files', () => {
            assert.file([
                `${SERVER_MAIN_SRC_DIR}com/mycompany/myapp/web/rest/FooResource.java`
            ]);

            assert.file([
                `${SERVER_TEST_SRC_DIR}com/mycompany/myapp/web/rest/FooResourceIntTest.java`
            ]);
        });
    });
});

{'fraction_non_alphanumeric': 0.15057154119038235, 'fraction_numerical': 0.0, 'mean_word_length': 2.1725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6791053', 'n_tokens_mistral': 723, 'n_tokens_neox': 698, 'n_words': 105}