Skip to content

Commit

Permalink
fix DisabledInAotMode for reactive+jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed May 3, 2024
1 parent c85071c commit 3dfae70
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions generators/server/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class extends ServerGenerator {
},
passthrough(file => {
const contents = file.contents.toString('utf8');
if (/@(MockBean|SpyBean)/.test(contents)) {
if (/@(MockBean|SpyBean)/.test(contents) || (application.reactive && /@AuthenticationIntegrationTest/.test(contents))) {
file.contents = Buffer.from(
addJavaAnnotation(contents, { package: 'org.springframework.test.context.aot', annotation: 'DisabledInAotMode' }),
);
Expand Down Expand Up @@ -285,14 +285,6 @@ class `,
);
},

reactiveJwtTestAdjust({ application: { reactive, javaPackageTestDir, generateUserManagement, packageName } }) {
if (reactive && generateUserManagement) {
this.editFile(`${javaPackageTestDir}security/jwt/AuthenticationIntegrationTest.java`, { assertModified: true }, content =>
content.replace(/(@Import\(\n {4}{\n)/, `$1 ${packageName}.security.DomainUserDetailsService.class,\n`),
);
}
},

keycloak({ application }) {
if (!application.authenticationTypeOauth2) return;

Expand Down

0 comments on commit 3dfae70

Please sign in to comment.