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 60b22f4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions generators/server/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,22 @@ 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 = ['UserServiceIT', 'MailServiceIT'];
for (const targetClass of targetClasses) {
const filePath = `${srcTestJava}${packageFolder}/service/${targetClass}.java`;
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 60b22f4

Please sign in to comment.