Skip to content

Commit

Permalink
Use need replacers
Browse files Browse the repository at this point in the history
  • Loading branch information
DamnClin committed Jul 29, 2022
1 parent 9690d55 commit 8a6ab68
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public JHipsterModule buildOauth2Module(JHipsterModuleProperties properties) {
.mandatoryReplacements()
.in("src/test/java/" + packagePath + "/cucumber/CucumberConfiguration.java")
.add(text(cucumberConfigurationNeedle), cucumberTestClasses(cucumberConfigurationNeedle))
.add(text(importNeedle), securityConfigurationImport(importNeedle, properties))
.add(lineBeforeText(importNeedle), securityConfigurationImport(properties))
.and()
.and()
.files()
Expand All @@ -62,14 +62,8 @@ private String cucumberTestClasses(String cucumberConfigurationNeedle) {
return cucumberConfigurationNeedle + ", TestSecurityConfiguration.class, CucumberAuthenticationConfiguration.class";
}

private String securityConfigurationImport(String importNeedle, JHipsterModuleProperties properties) {
return (
importNeedle +
JHipsterModule.LINE_BREAK +
"import " +
properties.basePackage().get() +
".authentication.infrastructure.primary.TestSecurityConfiguration;"
);
private String securityConfigurationImport(JHipsterModuleProperties properties) {
return ("import " + properties.basePackage().get() + ".authentication.infrastructure.primary.TestSecurityConfiguration;");
}

private JavaDependency jsonWebTokenDependency(String artifactId) {
Expand Down

0 comments on commit 8a6ab68

Please sign in to comment.