Skip to content

Commit

Permalink
disable some IT classes in AOT mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hide212131 committed Dec 18, 2023
1 parent 2b596fb commit c6c5b3b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions generators/server/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,24 @@ class `,
content.replace('start_period: 10s', 'start_period: 30s').replace('retries: 20', 'retries: 40'),
);
},

// workaround for https://github.com/spring-projects/spring-boot/issues/32195
disableMockBean({ application: { srcTestJava, packageFolder } }) {
const targetClasses = ['CustomClaimConverterIT', 'MailServiceIT', 'UserServiceIT'];
for (const targetClass of targetClasses) {
const filePath = `${srcTestJava}${packageFolder}/service/${targetClass}.java`;
if (this.existsDestination(filePath)) {
this.editFile(filePath, content =>
content
.replace(
`class ${targetClass}`,
`// workaround for https://github.com/spring-projects/spring-boot/issues/32195\n@DisabledInAotMode\nclass ${targetClass}`,
)
.replace(/(import .+;)\n/, '$1\nimport org.springframework.test.context.aot.DisabledInAotMode;\n'),
);
}
}
},
});
}

Expand Down

0 comments on commit c6c5b3b

Please sign in to comment.