diff --git a/generators/angular-audit/generator.js b/generators/angular-audit/generator.js index 3460946..00eab2f 100644 --- a/generators/angular-audit/generator.js +++ b/generators/angular-audit/generator.js @@ -4,6 +4,10 @@ import { clientApplicationTemplatesBlock } from 'generator-jhipster/generators/c export default class extends BaseApplicationGenerator { ngxDiff; + constructor(args, opts, features) { + super(args, opts, { ...features, queueCommandTasks: true }); + } + async beforeQueue() { await this.dependsOnJHipster('bootstrap-application'); } diff --git a/generators/client/generator.js b/generators/client/generator.js index e1bc9ad..58c7962 100644 --- a/generators/client/generator.js +++ b/generators/client/generator.js @@ -2,7 +2,7 @@ import BaseApplicationGenerator from 'generator-jhipster/generators/base-applica export default class extends BaseApplicationGenerator { constructor(args, opts, features) { - super(args, opts, { ...features, sbsBlueprint: true }); + super(args, opts, { ...features, queueCommandTasks: true, sbsBlueprint: true }); } async beforeQueue() { diff --git a/generators/java-audit/__snapshots__/generator.spec.js.snap b/generators/java-audit/__snapshots__/generator.spec.js.snap index d569f7e..a62a2dc 100644 --- a/generators/java-audit/__snapshots__/generator.spec.js.snap +++ b/generators/java-audit/__snapshots__/generator.spec.js.snap @@ -1,6 +1,160 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`SubGenerator java-audit of entity-audit JHipster blueprint > run > should succeed 1`] = ` +exports[`SubGenerator java-audit of entity-audit JHipster blueprint > run using auditFramework custom > should succeed 1`] = ` +{ + ".jhipster/Audited.json": { + "stateCleared": "modified", + }, + ".yo-rc.json": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/GeneratedByJHipster.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/audit/AsyncEntityAuditEventWriter.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/audit/EntityAuditEventListener.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/audit/EntityAuditEventWriter.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/audit/package-info.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/domain/Audited.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/domain/Authority.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/domain/EntityAuditEvent.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/domain/enumeration/EntityAuditAction.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/domain/enumeration/package-info.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/domain/package-info.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/package-info.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/repository/EntityAuditEventRepository.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/repository/package-info.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/web/rest/EntityAuditResource.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/web/rest/package-info.java": { + "stateCleared": "modified", + }, + "src/main/resources/config/liquibase/changelog/20220101000100_added_entity_EntityAuditEvent.xml": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/audit/TestEntityAuditEventWriter.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AssertUtils.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuditedAsserts.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuditedTest.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuditedTestSamples.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuthorityAsserts.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuthorityTest.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuthorityTestSamples.java": { + "stateCleared": "modified", + }, +} +`; + +exports[`SubGenerator java-audit of entity-audit JHipster blueprint > run using auditFramework javers > should succeed 1`] = ` +{ + ".jhipster/Audited.json": { + "stateCleared": "modified", + }, + ".yo-rc.json": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/GeneratedByJHipster.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/config/audit/JaversAuthorProvider.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/config/audit/package-info.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/domain/Audited.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/domain/Authority.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/domain/package-info.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/package-info.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/web/rest/JaversEntityAuditResource.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/web/rest/dto/EntityAuditAction.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/web/rest/dto/EntityAuditEvent.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/web/rest/dto/package-info.java": { + "stateCleared": "modified", + }, + "src/main/java/com/mycompany/myapp/web/rest/package-info.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AssertUtils.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuditedAsserts.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuditedTest.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuditedTestSamples.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuthorityAsserts.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuthorityTest.java": { + "stateCleared": "modified", + }, + "src/test/java/com/mycompany/myapp/domain/AuthorityTestSamples.java": { + "stateCleared": "modified", + }, +} +`; + +exports[`SubGenerator java-audit of entity-audit JHipster blueprint > run using auditFramework undefined > should succeed 1`] = ` { ".jhipster/Audited.json": { "stateCleared": "modified", diff --git a/generators/java-audit/command.js b/generators/java-audit/command.js index ea17f84..fa2858e 100644 --- a/generators/java-audit/command.js +++ b/generators/java-audit/command.js @@ -1,5 +1,75 @@ import { asCommand } from 'generator-jhipster'; export default asCommand({ - configs: {}, + configs: { + auditFramework: { + description: 'Audit framework', + cli: { + type: String, + }, + prompt: { + type: 'list', + message: 'Choose which audit framework you would like to use.', + default: 'custom', + }, + choices: [ + { + name: 'Custom JHipster auditing (works with SQL)', + value: 'custom', + }, + { + name: 'Javers auditing framework (works with SQL and MongoDB)', + value: 'javers', + }, + { + name: 'No auditing framework', + value: 'no', + }, + ], + scope: 'blueprint', + }, + auditPage: { + description: 'Generate client page', + cli: { + type: Boolean, + }, + prompt: { + type: 'confirm', + message: 'Do you want to add an audit log page for entities?', + default: true, + }, + scope: 'blueprint', + }, + auditUpdateType: { + cli: { + type: String, + }, + prompt: generator => ({ + when: answers => (generator.initialRun || generator.options.askAnswered) && ['javers', 'custom'].includes(answers.auditFramework), + type: 'list', + name: 'auditUpdateType', + message: 'Do you want to enable audit for all existing entities?', + choices: [ + { name: 'Yes, update all', value: 'all' }, + { name: 'No, let me choose the entities to update', value: 'selected' }, + ], + default: 'all', + }), + scope: 'generator', + }, + auditedEntities: { + description: 'Entities to be audited', + cli: { + type: Array, + }, + prompt: gen => ({ + when: answers => answers.auditUpdateType === 'selected', + type: 'checkbox', + message: 'Please choose the entities to be audited', + choices: gen.getExistingEntities().map(e => e.name), + default: [], + }), + scope: 'generator', + }, + }, }); diff --git a/generators/java-audit/generator.js b/generators/java-audit/generator.js index ff86375..c36635f 100644 --- a/generators/java-audit/generator.js +++ b/generators/java-audit/generator.js @@ -1,5 +1,5 @@ import BaseApplicationGenerator from 'generator-jhipster/generators/base-application'; -import { addJavaAnnotation, addJavaImport, javaMainPackageTemplatesBlock } from 'generator-jhipster/generators/java/support'; +import { javaMainPackageTemplatesBlock } from 'generator-jhipster/generators/java/support'; const COMMON_ATTRIBUTES = { // Hides form on create @@ -38,8 +38,23 @@ const ADDITIONAL_FIELDS = [ ]; export default class extends BaseApplicationGenerator { + auditUpdateType; + auditedEntities; + + constructor(args, opts, features) { + super(args, opts, { ...features, queueCommandTasks: true }); + } + async beforeQueue() { - await this.dependsOnJHipster('java'); + await this.dependsOnJHipster('jhipster:java:domain'); + } + + get [BaseApplicationGenerator.INITIALIZING]() { + return this.asInitializingTaskGroup({ + setInitialRun() { + this.initialRun = this.blueprintConfig.auditFramework === undefined; + }, + }); } get [BaseApplicationGenerator.COMPOSING]() { @@ -49,48 +64,17 @@ export default class extends BaseApplicationGenerator { await this.composeWithJHipster('jhipster-entity-audit:spring-boot-javers'); } else if (this.blueprintConfig.auditFramework === 'custom') { await this.composeWithJHipster('jhipster-entity-audit:spring-boot-custom-audit'); + } else { + this.cancelCancellableTasks(); } }, }); } - get [BaseApplicationGenerator.LOADING]() { - return this.asLoadingTaskGroup({ - prepareForTemplates({ application }) { - const { auditFramework, auditPage } = this.blueprintConfig; - application.auditFramework = auditFramework; - application.auditPage = auditPage; - }, - }); - } - - get [BaseApplicationGenerator.PREPARING]() { - return this.asPreparingTaskGroup({ - prepareForTemplates({ application }) { - const { auditFramework } = application; - application.auditFrameworkCustom = auditFramework === 'custom'; - application.auditFrameworkJavers = auditFramework === 'javers'; - application.auditFrameworkAny = auditFramework && auditFramework !== 'no'; - }, - editJavaFile({ source }) { - source.editJavaFile = - source.editJavaFile ?? - ((file, { staticImports = [], imports = [], annotations = [] }, ...editFileCallback) => - this.editFile( - file, - ...staticImports.map(classPath => addJavaImport(classPath, { staticImport: true })), - ...imports.map(classPath => addJavaImport(classPath)), - ...annotations.map(annotation => addJavaAnnotation(annotation)), - ...editFileCallback, - )); - }, - }); - } - get [BaseApplicationGenerator.CONFIGURING_EACH_ENTITY]() { return this.asConfiguringEachEntityTaskGroup({ async configureEntity({ entityName, entityConfig }) { - const { auditedEntities } = this.options; + const auditedEntities = this.auditUpdateType === 'all' ? this.getExistingEntities().map(e => e.name) : this.auditedEntities; entityConfig.enableAudit = auditedEntities?.includes(entityName) || entityConfig.enableAudit; if (!entityConfig.enableAudit) return; diff --git a/generators/java-audit/generator.spec.js b/generators/java-audit/generator.spec.js index fc5f368..51f2cab 100644 --- a/generators/java-audit/generator.spec.js +++ b/generators/java-audit/generator.spec.js @@ -6,36 +6,44 @@ const SUB_GENERATOR = 'java-audit'; const SUB_GENERATOR_NAMESPACE = `jhipster-entity-audit:${SUB_GENERATOR}`; describe('SubGenerator java-audit of entity-audit JHipster blueprint', () => { - describe('run', () => { - beforeAll(async function () { - await helpers - .run(SUB_GENERATOR_NAMESPACE) - .withJHipsterConfig({}, [ - { - name: 'Audited', - enableAudit: true, - fields: [ - { - fieldName: 'name', - fieldType: 'String', - }, - ], - }, - ]) - .withOptions({ - creationTimestamp: '2022-01-01', - ignoreNeedlesError: true, - }) - .withJHipsterLookup() - .withParentBlueprintLookup(); - }); + for (const auditFramework of [undefined, 'javers', 'custom']) { + describe(`run using auditFramework ${auditFramework}`, () => { + beforeAll(async function () { + await helpers + .run(SUB_GENERATOR_NAMESPACE) + .withJHipsterConfig({}, [ + { + name: 'Audited', + enableAudit: true, + fields: [ + { + fieldName: 'name', + fieldType: 'String', + }, + ], + }, + ]) + .withOptions({ + creationTimestamp: '2022-01-01', + ignoreNeedlesError: true, + auditFramework, + }) + .withJHipsterLookup() + .withParentBlueprintLookup(); + }); - it('should succeed', () => { - expect(result.getStateSnapshot()).toMatchSnapshot(); - }); - it('entities should extend AbstractAuditingEntity', () => { - // TODO remove jhi extension - result.assertFileContent('src/main/java/com/mycompany/myapp/domain/Audited.java', ' AbstractAuditingEntity<'); + it('should succeed', () => { + expect(result.getStateSnapshot()).toMatchSnapshot(); + }); + if (auditFramework) { + it('entities should extend AbstractAuditingEntity', () => { + result.assertFileContent('src/main/java/com/mycompany/myapp/domain/Audited.java', ' AbstractAuditingEntity<'); + }); + } else { + it('entities should not extend AbstractAuditingEntity', () => { + result.assertNoFileContent('src/main/java/com/mycompany/myapp/domain/Audited.java', ' AbstractAuditingEntity<'); + }); + } }); - }); + } }); diff --git a/generators/languages/generator.js b/generators/languages/generator.js index 7621f7b..a2cc2fe 100644 --- a/generators/languages/generator.js +++ b/generators/languages/generator.js @@ -4,7 +4,7 @@ import BaseApplicationGenerator from 'generator-jhipster/generators/base-applica export default class extends BaseApplicationGenerator { constructor(args, opts, features) { - super(args, opts, { ...features, sbsBlueprint: true }); + super(args, opts, { ...features, queueCommandTasks: true, sbsBlueprint: true }); } async beforeQueue() { diff --git a/generators/server/__snapshots__/generator.spec.js.snap b/generators/server/__snapshots__/generator.spec.js.snap index 21577b5..f3d18d7 100644 --- a/generators/server/__snapshots__/generator.spec.js.snap +++ b/generators/server/__snapshots__/generator.spec.js.snap @@ -116,18 +116,6 @@ exports[`SubGenerator server of entity-audit JHipster blueprint > run > should s "src/main/java/com/mycompany/myapp/aop/logging/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/audit/AsyncEntityAuditEventWriter.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/audit/EntityAuditEventListener.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/audit/EntityAuditEventWriter.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/audit/package-info.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/config/ApplicationProperties.java": { "stateCleared": "modified", }, @@ -182,18 +170,9 @@ exports[`SubGenerator server of entity-audit JHipster blueprint > run > should s "src/main/java/com/mycompany/myapp/domain/Authority.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/domain/EntityAuditEvent.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/domain/User.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/domain/enumeration/EntityAuditAction.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/domain/enumeration/package-info.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/domain/package-info.java": { "stateCleared": "modified", }, @@ -209,9 +188,6 @@ exports[`SubGenerator server of entity-audit JHipster blueprint > run > should s "src/main/java/com/mycompany/myapp/repository/AuthorityRepository.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/repository/EntityAuditEventRepository.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/repository/UserRepository.java": { "stateCleared": "modified", }, @@ -287,9 +263,6 @@ exports[`SubGenerator server of entity-audit JHipster blueprint > run > should s "src/main/java/com/mycompany/myapp/web/rest/AuthorityResource.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/web/rest/EntityAuditResource.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/web/rest/PublicUserResource.java": { "stateCleared": "modified", }, @@ -353,9 +326,6 @@ exports[`SubGenerator server of entity-audit JHipster blueprint > run > should s "src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml": { "stateCleared": "modified", }, - "src/main/resources/config/liquibase/changelog/20220101000100_added_entity_EntityAuditEvent.xml": { - "stateCleared": "modified", - }, "src/main/resources/config/liquibase/data/authority.csv": { "stateCleared": "modified", }, @@ -449,9 +419,6 @@ exports[`SubGenerator server of entity-audit JHipster blueprint > run > should s "src/test/java/com/mycompany/myapp/TechnicalStructureTest.java": { "stateCleared": "modified", }, - "src/test/java/com/mycompany/myapp/audit/TestEntityAuditEventWriter.java": { - "stateCleared": "modified", - }, "src/test/java/com/mycompany/myapp/config/AsyncSyncConfiguration.java": { "stateCleared": "modified", }, diff --git a/generators/server/command.js b/generators/server/command.js index 69febfb..2023562 100644 --- a/generators/server/command.js +++ b/generators/server/command.js @@ -2,71 +2,6 @@ import { asCommand } from 'generator-jhipster'; export default asCommand({ options: {}, - configs: { - auditFramework: { - description: 'Audit framework', - cli: { - type: String, - }, - prompt: { - type: 'list', - message: 'Choose which audit framework you would like to use.', - default: 'custom', - }, - choices: [ - { - name: 'Custom JHipster auditing (works with SQL)', - value: 'custom', - }, - { - name: 'Javers auditing framework (works with SQL and MongoDB)', - value: 'javers', - }, - ], - scope: 'blueprint', - }, - auditPage: { - description: 'Generate client page', - cli: { - type: Boolean, - }, - prompt: { - type: 'confirm', - message: 'Do you want to add an audit log page for entities?', - default: true, - }, - scope: 'blueprint', - }, - auditUpdateType: { - cli: { - type: String, - }, - prompt: generator => ({ - when: answers => (generator.initialRun || generator.options.askAnswered) && ['javers', 'custom'].includes(answers.auditFramework), - type: 'list', - name: 'auditUpdateType', - message: 'Do you want to enable audit for all existing entities?', - choices: [ - { name: 'Yes, update all', value: 'all' }, - { name: 'No, let me choose the entities to update', value: 'selected' }, - ], - default: 'all', - }), - scope: 'generator', - }, - auditedEntities: { - description: 'Entities to be audited', - cli: { - type: Array, - }, - prompt: gen => ({ - when: answers => answers.auditUpdateType === 'selected', - type: 'checkbox', - message: 'Please choose the entities to be audited', - choices: gen.getExistingEntities().map(e => e.name), - default: [], - }), - scope: 'generator', - }, - }, + configs: {}, + import: ['jhipster-entity-audit:java-audit'], }); diff --git a/generators/server/generator.js b/generators/server/generator.js index 6906389..c36fdd2 100644 --- a/generators/server/generator.js +++ b/generators/server/generator.js @@ -1,40 +1,14 @@ import BaseApplicationGenerator from 'generator-jhipster/generators/base-application'; -import command from './command.js'; export default class extends BaseApplicationGenerator { - initialRun; - auditedEntities; - constructor(args, opts, features) { - super(args, opts, { ...features, sbsBlueprint: true }); - } - - get [BaseApplicationGenerator.INITIALIZING]() { - return this.asInitializingTaskGroup({ - setInitialRun() { - this.initialRun = this.blueprintConfig.auditFramework === undefined; - }, - async initializeOptions() { - this.parseJHipsterCommand(command); - }, - }); - } - - get [BaseApplicationGenerator.PROMPTING]() { - return this.asPromptingTaskGroup({ - async promptingTemplateTask() { - await this.prompt(this.prepareQuestions(command.configs)); - }, - }); + super(args, opts, { ...features, queueCommandTasks: true, sbsBlueprint: true }); } get [BaseApplicationGenerator.COMPOSING]() { return this.asComposingTaskGroup({ async composingTask() { - if (this.blueprintConfig.auditFramework && this.blueprintConfig.auditFramework !== 'no') { - const auditedEntities = this.auditUpdateType === 'all' ? this.getExistingEntities().map(e => e.name) : this.auditedEntities; - await this.composeWithJHipster('jhipster-entity-audit:java-audit', { generatorOptions: { auditedEntities } }); - } + await this.composeWithJHipster('jhipster-entity-audit:java-audit'); }, }); } diff --git a/generators/server/generator.spec.js b/generators/server/generator.spec.js index 10472b6..5aff342 100644 --- a/generators/server/generator.spec.js +++ b/generators/server/generator.spec.js @@ -3,13 +3,12 @@ import { beforeAll, describe, expect, it } from 'vitest'; import { defaultHelpers as helpers, result } from 'generator-jhipster/testing'; const SUB_GENERATOR = 'server'; -const BLUEPRINT_NAMESPACE = `jhipster:${SUB_GENERATOR}`; describe('SubGenerator server of entity-audit JHipster blueprint', () => { describe('run', () => { beforeAll(async function () { await helpers - .run(BLUEPRINT_NAMESPACE) + .runJHipster(SUB_GENERATOR) .withJHipsterConfig() .withOptions({ creationTimestamp: '2022-01-01', @@ -17,12 +16,16 @@ describe('SubGenerator server of entity-audit JHipster blueprint', () => { blueprint: ['entity-audit'], }) .withJHipsterLookup() - .withParentBlueprintLookup(); + .withParentBlueprintLookup() + .withMockedGenerators(['jhipster-entity-audit:java-audit']); }); it('should succeed', () => { expect(result.getStateSnapshot()).toMatchSnapshot(); }); + it('should compose with jhipster-entity-audit:java-audit', () => { + result.assertGeneratorComposedOnce('jhipster-entity-audit:java-audit'); + }); it('should not write audit files', () => { expect(result.getStateSnapshot('**/audit/**')).toMatchObject({}); }); diff --git a/generators/spring-boot-custom-audit/__snapshots__/generator.spec.js.snap b/generators/spring-boot-custom-audit/__snapshots__/generator.spec.js.snap index e89b2ec..ab5143a 100644 --- a/generators/spring-boot-custom-audit/__snapshots__/generator.spec.js.snap +++ b/generators/spring-boot-custom-audit/__snapshots__/generator.spec.js.snap @@ -2,123 +2,15 @@ exports[`SubGenerator spring-boot-custom-audit of entity-audit JHipster blueprint > run > should succeed 1`] = ` { - ".devcontainer/Dockerfile": { - "stateCleared": "modified", - }, - ".devcontainer/devcontainer.json": { - "stateCleared": "modified", - }, - ".editorconfig": { - "stateCleared": "modified", - }, - ".gitattributes": { - "stateCleared": "modified", - }, - ".gitignore": { - "stateCleared": "modified", - }, - ".husky/pre-commit": { - "stateCleared": "modified", - }, ".jhipster/Audited.json": { "stateCleared": "modified", }, - ".lintstagedrc.cjs": { - "stateCleared": "modified", - }, - ".mvn/jvm.config": { - "stateCleared": "modified", - }, - ".mvn/wrapper/maven-wrapper.jar": { - "stateCleared": "modified", - }, - ".mvn/wrapper/maven-wrapper.properties": { - "stateCleared": "modified", - }, - ".prettierignore": { - "stateCleared": "modified", - }, - ".prettierrc": { - "stateCleared": "modified", - }, ".yo-rc.json": { "stateCleared": "modified", }, - "README.md": { - "stateCleared": "modified", - }, - "checkstyle.xml": { - "stateCleared": "modified", - }, - "mvnw": { - "stateCleared": "modified", - }, - "mvnw.cmd": { - "stateCleared": "modified", - }, - "npmw": { - "stateCleared": "modified", - }, - "npmw.cmd": { - "stateCleared": "modified", - }, - "package.json": { - "stateCleared": "modified", - }, - "pom.xml": { - "stateCleared": "modified", - }, - "sonar-project.properties": { - "stateCleared": "modified", - }, - "src/main/docker/app.yml": { - "stateCleared": "modified", - }, - "src/main/docker/grafana/provisioning/dashboards/JVM.json": { - "stateCleared": "modified", - }, - "src/main/docker/grafana/provisioning/dashboards/dashboard.yml": { - "stateCleared": "modified", - }, - "src/main/docker/grafana/provisioning/datasources/datasource.yml": { - "stateCleared": "modified", - }, - "src/main/docker/jhipster-control-center.yml": { - "stateCleared": "modified", - }, - "src/main/docker/jib/entrypoint.sh": { - "stateCleared": "modified", - }, - "src/main/docker/monitoring.yml": { - "stateCleared": "modified", - }, - "src/main/docker/postgresql.yml": { - "stateCleared": "modified", - }, - "src/main/docker/prometheus/prometheus.yml": { - "stateCleared": "modified", - }, - "src/main/docker/services.yml": { - "stateCleared": "modified", - }, - "src/main/docker/sonar.yml": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/ApplicationWebXml.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/GeneratedByJHipster.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/JhipsterApp.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/aop/logging/LoggingAspect.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/aop/logging/package-info.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/audit/AsyncEntityAuditEventWriter.java": { "stateCleared": "modified", }, @@ -131,57 +23,6 @@ exports[`SubGenerator spring-boot-custom-audit of entity-audit JHipster blueprin "src/main/java/com/mycompany/myapp/audit/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/config/ApplicationProperties.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/AsyncConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/CRLFLogConverter.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/CacheConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/Constants.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/DatabaseConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/DateTimeFormatConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/JacksonConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/LiquibaseConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/LoggingAspectConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/LoggingConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/SecurityConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/SecurityJwtConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/StaticResourcesWebConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/WebConfigurer.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/domain/AbstractAuditingEntity.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/domain/Audited.java": { "stateCleared": "modified", }, @@ -191,9 +32,6 @@ exports[`SubGenerator spring-boot-custom-audit of entity-audit JHipster blueprin "src/main/java/com/mycompany/myapp/domain/EntityAuditEvent.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/domain/User.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/domain/enumeration/EntityAuditAction.java": { "stateCleared": "modified", }, @@ -203,306 +41,27 @@ exports[`SubGenerator spring-boot-custom-audit of entity-audit JHipster blueprin "src/main/java/com/mycompany/myapp/domain/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/management/SecurityMetersService.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/management/package-info.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/repository/AuditedRepository.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/repository/AuthorityRepository.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/repository/EntityAuditEventRepository.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/repository/UserRepository.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/repository/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/security/AuthoritiesConstants.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/DomainUserDetailsService.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/SecurityUtils.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/SpringSecurityAuditorAware.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/UserNotActivatedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/EmailAlreadyUsedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/InvalidPasswordException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/MailService.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/UserService.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/UsernameAlreadyUsedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/dto/AdminUserDTO.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/dto/PasswordChangeDTO.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/dto/UserDTO.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/dto/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/mapper/UserMapper.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/mapper/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/filter/SpaWebFilter.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/filter/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/AccountResource.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/AuditedResource.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/AuthenticateController.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/AuthorityResource.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/web/rest/EntityAuditResource.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/web/rest/PublicUserResource.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/UserResource.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/BadRequestAlertException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/EmailAlreadyUsedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/ErrorConstants.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/ExceptionTranslator.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/FieldErrorVM.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/InvalidPasswordException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/LoginAlreadyUsedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/package-info.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/web/rest/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/web/rest/vm/KeyAndPasswordVM.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/vm/LoginVM.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/vm/ManagedUserVM.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/vm/package-info.java": { - "stateCleared": "modified", - }, - "src/main/resources/banner.txt": { - "stateCleared": "modified", - }, - "src/main/resources/config/application-dev.yml": { - "stateCleared": "modified", - }, - "src/main/resources/config/application-prod.yml": { - "stateCleared": "modified", - }, - "src/main/resources/config/application-tls.yml": { - "stateCleared": "modified", - }, - "src/main/resources/config/application.yml": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml": { - "stateCleared": "modified", - }, "src/main/resources/config/liquibase/changelog/20220101000100_added_entity_EntityAuditEvent.xml": { "stateCleared": "modified", }, - "src/main/resources/config/liquibase/changelog/20220101000200_added_entity_Audited.xml": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/data/authority.csv": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/data/user.csv": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/data/user_authority.csv": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/fake-data/audited.csv": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/master.xml": { - "stateCleared": "modified", - }, - "src/main/resources/config/tls/keystore.p12": { - "stateCleared": "modified", - }, - "src/main/resources/i18n/messages.properties": { - "stateCleared": "modified", - }, - "src/main/resources/i18n/messages_en.properties": { - "stateCleared": "modified", - }, - "src/main/resources/logback-spring.xml": { - "stateCleared": "modified", - }, - "src/main/resources/templates/error.html": { - "stateCleared": "modified", - }, - "src/main/resources/templates/mail/activationEmail.html": { - "stateCleared": "modified", - }, - "src/main/resources/templates/mail/creationEmail.html": { - "stateCleared": "modified", - }, - "src/main/resources/templates/mail/passwordResetEmail.html": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/activate.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/adminAuthority.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/audited.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/configuration.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/error.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/global.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/health.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/home.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/login.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/logs.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/metrics.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/password.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/register.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/reset.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/sessions.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/settings.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/user-management.json": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/IntegrationTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/TechnicalStructureTest.java": { - "stateCleared": "modified", - }, "src/test/java/com/mycompany/myapp/audit/TestEntityAuditEventWriter.java": { "stateCleared": "modified", }, - "src/test/java/com/mycompany/myapp/config/AsyncSyncConfiguration.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/CRLFLogConverterTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/EmbeddedSQL.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/PostgreSqlTestContainer.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/SpringBootTestClassOrderer.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/SqlTestContainer.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/WebConfigurerTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/WebConfigurerTestController.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/timezone/HibernateTimeZoneIT.java": { - "stateCleared": "modified", - }, "src/test/java/com/mycompany/myapp/domain/AssertUtils.java": { "stateCleared": "modified", }, @@ -524,107 +83,5 @@ exports[`SubGenerator spring-boot-custom-audit of entity-audit JHipster blueprin "src/test/java/com/mycompany/myapp/domain/AuthorityTestSamples.java": { "stateCleared": "modified", }, - "src/test/java/com/mycompany/myapp/management/SecurityMetersServiceTests.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/repository/timezone/DateTimeWrapper.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/repository/timezone/DateTimeWrapperRepository.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/DomainUserDetailsServiceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/SecurityUtilsUnitTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/jwt/AuthenticationIntegrationTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/jwt/JwtAuthenticationTestUtils.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/jwt/TokenAuthenticationIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/jwt/TokenAuthenticationSecurityMetersIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/service/MailServiceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/service/UserServiceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/service/mapper/UserMapperTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/filter/SpaWebFilterIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/AccountResourceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/AuditedResourceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/AuthenticateControllerIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/AuthorityResourceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/PublicUserResourceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/TestUtil.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/UserResourceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/WithUnauthenticatedMockUser.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/errors/ExceptionTranslatorIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/errors/ExceptionTranslatorTestController.java": { - "stateCleared": "modified", - }, - "src/test/resources/META-INF/spring.factories": { - "stateCleared": "modified", - }, - "src/test/resources/config/application-testdev.yml": { - "stateCleared": "modified", - }, - "src/test/resources/config/application-testprod.yml": { - "stateCleared": "modified", - }, - "src/test/resources/config/application.yml": { - "stateCleared": "modified", - }, - "src/test/resources/i18n/messages_en.properties": { - "stateCleared": "modified", - }, - "src/test/resources/junit-platform.properties": { - "stateCleared": "modified", - }, - "src/test/resources/logback.xml": { - "stateCleared": "modified", - }, - "src/test/resources/templates/mail/activationEmail.html": { - "stateCleared": "modified", - }, - "src/test/resources/templates/mail/creationEmail.html": { - "stateCleared": "modified", - }, - "src/test/resources/templates/mail/passwordResetEmail.html": { - "stateCleared": "modified", - }, - "src/test/resources/templates/mail/testEmail.html": { - "stateCleared": "modified", - }, } `; diff --git a/generators/spring-boot-custom-audit/generator.js b/generators/spring-boot-custom-audit/generator.js index c03f440..b03d5f5 100644 --- a/generators/spring-boot-custom-audit/generator.js +++ b/generators/spring-boot-custom-audit/generator.js @@ -3,9 +3,13 @@ import BaseApplicationGenerator from 'generator-jhipster/generators/base-applica import { javaMainPackageTemplatesBlock, javaTestPackageTemplatesBlock } from 'generator-jhipster/generators/java/support'; export default class extends BaseApplicationGenerator { + constructor(args, opts, features) { + super(args, opts, { ...features, queueCommandTasks: true }); + } + async beforeQueue() { + await this.dependsOnBootstrapApplicationBase(); await this.dependsOnJHipster('jhipster-entity-audit:java-audit'); - await this.dependsOnJHipster('spring-boot'); } get [BaseApplicationGenerator.CONFIGURING]() { diff --git a/generators/spring-boot-custom-audit/generator.spec.js b/generators/spring-boot-custom-audit/generator.spec.js index 383f52e..b703a88 100644 --- a/generators/spring-boot-custom-audit/generator.spec.js +++ b/generators/spring-boot-custom-audit/generator.spec.js @@ -24,6 +24,7 @@ describe('SubGenerator spring-boot-custom-audit of entity-audit JHipster bluepri .withOptions({ creationTimestamp: '2022-01-01', ignoreNeedlesError: true, + auditFramework: 'custom', }) .withJHipsterLookup() .withParentBlueprintLookup(); diff --git a/generators/spring-boot-javers/__snapshots__/generator.spec.js.snap b/generators/spring-boot-javers/__snapshots__/generator.spec.js.snap index 1198695..47508b5 100644 --- a/generators/spring-boot-javers/__snapshots__/generator.spec.js.snap +++ b/generators/spring-boot-javers/__snapshots__/generator.spec.js.snap @@ -2,282 +2,30 @@ exports[`SubGenerator spring-boot-javers of entity-audit JHipster blueprint > run > should succeed 1`] = ` { - ".devcontainer/Dockerfile": { - "stateCleared": "modified", - }, - ".devcontainer/devcontainer.json": { - "stateCleared": "modified", - }, - ".editorconfig": { - "stateCleared": "modified", - }, - ".gitattributes": { - "stateCleared": "modified", - }, - ".gitignore": { - "stateCleared": "modified", - }, - ".husky/pre-commit": { - "stateCleared": "modified", - }, - ".lintstagedrc.cjs": { - "stateCleared": "modified", - }, - ".mvn/jvm.config": { - "stateCleared": "modified", - }, - ".mvn/wrapper/maven-wrapper.jar": { - "stateCleared": "modified", - }, - ".mvn/wrapper/maven-wrapper.properties": { - "stateCleared": "modified", - }, - ".prettierignore": { - "stateCleared": "modified", - }, - ".prettierrc": { - "stateCleared": "modified", - }, ".yo-rc.json": { "stateCleared": "modified", }, - "README.md": { - "stateCleared": "modified", - }, - "checkstyle.xml": { - "stateCleared": "modified", - }, - "mvnw": { - "stateCleared": "modified", - }, - "mvnw.cmd": { - "stateCleared": "modified", - }, - "npmw": { - "stateCleared": "modified", - }, - "npmw.cmd": { - "stateCleared": "modified", - }, - "package.json": { - "stateCleared": "modified", - }, - "pom.xml": { - "stateCleared": "modified", - }, - "sonar-project.properties": { - "stateCleared": "modified", - }, - "src/main/docker/app.yml": { - "stateCleared": "modified", - }, - "src/main/docker/grafana/provisioning/dashboards/JVM.json": { - "stateCleared": "modified", - }, - "src/main/docker/grafana/provisioning/dashboards/dashboard.yml": { - "stateCleared": "modified", - }, - "src/main/docker/grafana/provisioning/datasources/datasource.yml": { - "stateCleared": "modified", - }, - "src/main/docker/jhipster-control-center.yml": { - "stateCleared": "modified", - }, - "src/main/docker/jib/entrypoint.sh": { - "stateCleared": "modified", - }, - "src/main/docker/monitoring.yml": { - "stateCleared": "modified", - }, - "src/main/docker/postgresql.yml": { - "stateCleared": "modified", - }, - "src/main/docker/prometheus/prometheus.yml": { - "stateCleared": "modified", - }, - "src/main/docker/services.yml": { - "stateCleared": "modified", - }, - "src/main/docker/sonar.yml": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/ApplicationWebXml.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/GeneratedByJHipster.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/JhipsterApp.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/aop/logging/LoggingAspect.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/aop/logging/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/ApplicationProperties.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/AsyncConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/CRLFLogConverter.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/CacheConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/Constants.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/DatabaseConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/DateTimeFormatConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/JacksonConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/LiquibaseConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/LoggingAspectConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/LoggingConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/SecurityConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/SecurityJwtConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/StaticResourcesWebConfiguration.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/config/WebConfigurer.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/config/audit/JaversAuthorProvider.java": { "stateCleared": "modified", }, "src/main/java/com/mycompany/myapp/config/audit/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/config/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/domain/AbstractAuditingEntity.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/domain/Authority.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/domain/User.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/domain/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/management/SecurityMetersService.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/management/package-info.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/repository/AuthorityRepository.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/repository/UserRepository.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/repository/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/AuthoritiesConstants.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/DomainUserDetailsService.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/SecurityUtils.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/SpringSecurityAuditorAware.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/UserNotActivatedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/security/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/EmailAlreadyUsedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/InvalidPasswordException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/MailService.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/UserService.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/UsernameAlreadyUsedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/dto/AdminUserDTO.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/dto/PasswordChangeDTO.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/dto/UserDTO.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/dto/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/mapper/UserMapper.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/mapper/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/service/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/filter/SpaWebFilter.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/filter/package-info.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/AccountResource.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/AuthenticateController.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/AuthorityResource.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/web/rest/JaversEntityAuditResource.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/web/rest/PublicUserResource.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/UserResource.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/web/rest/dto/EntityAuditAction.java": { "stateCleared": "modified", }, @@ -287,186 +35,9 @@ exports[`SubGenerator spring-boot-javers of entity-audit JHipster blueprint > ru "src/main/java/com/mycompany/myapp/web/rest/dto/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/web/rest/errors/BadRequestAlertException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/EmailAlreadyUsedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/ErrorConstants.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/ExceptionTranslator.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/FieldErrorVM.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/InvalidPasswordException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/LoginAlreadyUsedException.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/errors/package-info.java": { - "stateCleared": "modified", - }, "src/main/java/com/mycompany/myapp/web/rest/package-info.java": { "stateCleared": "modified", }, - "src/main/java/com/mycompany/myapp/web/rest/vm/KeyAndPasswordVM.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/vm/LoginVM.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/vm/ManagedUserVM.java": { - "stateCleared": "modified", - }, - "src/main/java/com/mycompany/myapp/web/rest/vm/package-info.java": { - "stateCleared": "modified", - }, - "src/main/resources/banner.txt": { - "stateCleared": "modified", - }, - "src/main/resources/config/application-dev.yml": { - "stateCleared": "modified", - }, - "src/main/resources/config/application-prod.yml": { - "stateCleared": "modified", - }, - "src/main/resources/config/application-tls.yml": { - "stateCleared": "modified", - }, - "src/main/resources/config/application.yml": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/data/authority.csv": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/data/user.csv": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/data/user_authority.csv": { - "stateCleared": "modified", - }, - "src/main/resources/config/liquibase/master.xml": { - "stateCleared": "modified", - }, - "src/main/resources/config/tls/keystore.p12": { - "stateCleared": "modified", - }, - "src/main/resources/i18n/messages.properties": { - "stateCleared": "modified", - }, - "src/main/resources/i18n/messages_en.properties": { - "stateCleared": "modified", - }, - "src/main/resources/logback-spring.xml": { - "stateCleared": "modified", - }, - "src/main/resources/templates/error.html": { - "stateCleared": "modified", - }, - "src/main/resources/templates/mail/activationEmail.html": { - "stateCleared": "modified", - }, - "src/main/resources/templates/mail/creationEmail.html": { - "stateCleared": "modified", - }, - "src/main/resources/templates/mail/passwordResetEmail.html": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/activate.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/adminAuthority.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/configuration.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/error.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/global.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/health.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/home.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/login.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/logs.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/metrics.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/password.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/register.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/reset.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/sessions.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/settings.json": { - "stateCleared": "modified", - }, - "src/main/webapp/i18n/en/user-management.json": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/IntegrationTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/TechnicalStructureTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/AsyncSyncConfiguration.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/CRLFLogConverterTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/EmbeddedSQL.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/PostgreSqlTestContainer.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/SpringBootTestClassOrderer.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/SqlTestContainer.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/SqlTestContainersSpringContextCustomizerFactory.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/StaticResourcesWebConfigurerTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/WebConfigurerTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/WebConfigurerTestController.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/config/timezone/HibernateTimeZoneIT.java": { - "stateCleared": "modified", - }, "src/test/java/com/mycompany/myapp/domain/AssertUtils.java": { "stateCleared": "modified", }, @@ -479,104 +50,5 @@ exports[`SubGenerator spring-boot-javers of entity-audit JHipster blueprint > ru "src/test/java/com/mycompany/myapp/domain/AuthorityTestSamples.java": { "stateCleared": "modified", }, - "src/test/java/com/mycompany/myapp/management/SecurityMetersServiceTests.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/repository/timezone/DateTimeWrapper.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/repository/timezone/DateTimeWrapperRepository.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/DomainUserDetailsServiceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/SecurityUtilsUnitTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/jwt/AuthenticationIntegrationTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/jwt/JwtAuthenticationTestUtils.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/jwt/TokenAuthenticationIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/security/jwt/TokenAuthenticationSecurityMetersIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/service/MailServiceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/service/UserServiceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/service/mapper/UserMapperTest.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/filter/SpaWebFilterIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/AccountResourceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/AuthenticateControllerIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/AuthorityResourceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/PublicUserResourceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/TestUtil.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/UserResourceIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/WithUnauthenticatedMockUser.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/errors/ExceptionTranslatorIT.java": { - "stateCleared": "modified", - }, - "src/test/java/com/mycompany/myapp/web/rest/errors/ExceptionTranslatorTestController.java": { - "stateCleared": "modified", - }, - "src/test/resources/META-INF/spring.factories": { - "stateCleared": "modified", - }, - "src/test/resources/config/application-testdev.yml": { - "stateCleared": "modified", - }, - "src/test/resources/config/application-testprod.yml": { - "stateCleared": "modified", - }, - "src/test/resources/config/application.yml": { - "stateCleared": "modified", - }, - "src/test/resources/i18n/messages_en.properties": { - "stateCleared": "modified", - }, - "src/test/resources/junit-platform.properties": { - "stateCleared": "modified", - }, - "src/test/resources/logback.xml": { - "stateCleared": "modified", - }, - "src/test/resources/templates/mail/activationEmail.html": { - "stateCleared": "modified", - }, - "src/test/resources/templates/mail/creationEmail.html": { - "stateCleared": "modified", - }, - "src/test/resources/templates/mail/passwordResetEmail.html": { - "stateCleared": "modified", - }, - "src/test/resources/templates/mail/testEmail.html": { - "stateCleared": "modified", - }, } `; diff --git a/generators/spring-boot-javers/generator.js b/generators/spring-boot-javers/generator.js index 3e2c2bb..6050b95 100644 --- a/generators/spring-boot-javers/generator.js +++ b/generators/spring-boot-javers/generator.js @@ -4,9 +4,13 @@ import { javaMainPackageTemplatesBlock } from 'generator-jhipster/generators/jav import { getPomVersionProperties } from 'generator-jhipster/generators/server/support'; export default class extends BaseApplicationGenerator { + constructor(args, opts, features) { + super(args, opts, { ...features, queueCommandTasks: true }); + } + async beforeQueue() { + await this.dependsOnBootstrapApplicationBase(); await this.dependsOnJHipster('jhipster-entity-audit:java-audit'); - await this.dependsOnJHipster('spring-boot'); } get [BaseApplicationGenerator.PREPARING]() { diff --git a/generators/spring-boot-javers/generator.spec.js b/generators/spring-boot-javers/generator.spec.js index ba212ff..06acf4f 100644 --- a/generators/spring-boot-javers/generator.spec.js +++ b/generators/spring-boot-javers/generator.spec.js @@ -13,6 +13,7 @@ describe('SubGenerator spring-boot-javers of entity-audit JHipster blueprint', ( .withJHipsterConfig() .withOptions({ ignoreNeedlesError: true, + auditFramework: 'javers', }) .withJHipsterLookup() .withParentBlueprintLookup(); diff --git a/package-lock.json b/package-lock.json index d12ea46..b0a30b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "yeoman-test": ">=8.2.0" }, "engines": { - "generator-jhipster": "8.7.1", + "generator-jhipster": "^8.7.1", "node": "^18.19.0 || >= 20.6.1" } },