-
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10578 from renanfranca/10553-define-preset-json-f…
…ile-name-at-spring-boot-application define preset json file name at spring boot application config
- Loading branch information
Showing
8 changed files
with
83 additions
and
10 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/main/java/tech/jhipster/lite/project/domain/resource/JHipsterPresetFile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package tech.jhipster.lite.project.domain.resource; | ||
|
||
public record JHipsterPresetFile(String name) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...ava/tech/jhipster/lite/project/infrastructure/secondary/JHipsterPresetFileProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package tech.jhipster.lite.project.infrastructure.secondary; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
@ConfigurationProperties("jhlite-preset-file") | ||
class JHipsterPresetFileProperties { | ||
|
||
private String name; | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...ster/lite/project/infrastructure/secondary/JHipsterPresetFilePropertiesConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package tech.jhipster.lite.project.infrastructure.secondary; | ||
|
||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import tech.jhipster.lite.project.domain.resource.JHipsterPresetFile; | ||
|
||
@Configuration | ||
@EnableConfigurationProperties(JHipsterPresetFileProperties.class) | ||
class JHipsterPresetFilePropertiesConfiguration { | ||
|
||
@Bean | ||
JHipsterPresetFile jhipsterPresetFile() { | ||
return new JHipsterPresetFile(new JHipsterPresetFileProperties().getName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...lite/project/infrastructure/secondary/FakedJHipsterPresetFilePropertiesConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package tech.jhipster.lite.project.infrastructure.secondary; | ||
|
||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.context.annotation.Bean; | ||
import tech.jhipster.lite.project.domain.resource.JHipsterPresetFile; | ||
|
||
@TestConfiguration | ||
public class FakedJHipsterPresetFilePropertiesConfiguration { | ||
|
||
@Bean | ||
JHipsterPresetFile jhipsterPresetFile() { | ||
return new JHipsterPresetFile("preset.json"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters