Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): rename property initially to defaults #1092

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,25 @@ public static class Group {
@Getter
@Setter
public static class UI {
/**
* Allows to show or hide the bindings in the UI when opening the UI.
*/
private boolean initiallyShowBindings = true;

/**
* Allows to show or hide the headers in the UI when opening the UI.
* Initial configuration when opening the UI.
*/
private boolean initiallyShowHeaders = true;
private Defaults defaults = new Defaults();

@Getter
@Setter
public static class Defaults {
/**
* Allows to show or hide the bindings in the UI when opening the UI.
*/
private boolean showBindings = true;

/**
* Allows to show or hide the headers in the UI when opening the UI.
*/
private boolean showHeaders = true;
}
}

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ private List<UiConfig.UiConfigGroup> createGroups() {
}

private UiConfig.InitialConfig createInitialConfig() {
return new UiConfig.InitialConfig(
configProperties.getUi().isInitiallyShowBindings(),
configProperties.getUi().isInitiallyShowHeaders());
SpringwolfConfigProperties.UI.Defaults defaults =
configProperties.getUi().getDefaults();
return new UiConfig.InitialConfig(defaults.isShowBindings(), defaults.isShowHeaders());
}

private record UiConfig(InitialConfig initialConfig, List<UiConfigGroup> groups) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void groupConfigIsMappedCorrectly() {
@ExtendWith(SpringExtension.class)
@EnableConfigurationProperties(SpringwolfConfigProperties.class)
@TestPropertySource(
properties = {"springwolf.ui.initially-show-bindings=false", "springwolf.ui.initially-show-headers=true"})
properties = {"springwolf.ui.defaults.show-bindings=false", "springwolf.ui.defaults.show-headers=true"})
class UiConfigTest {

@Autowired
Expand All @@ -224,8 +224,8 @@ void uiConfigIsMappedCorrectly() {
final SpringwolfConfigProperties.UI actual = properties.getUi();

// then
assertThat(actual.isInitiallyShowBindings()).isFalse();
assertThat(actual.isInitiallyShowHeaders()).isTrue();
assertThat(actual.getDefaults().isShowBindings()).isFalse();
assertThat(actual.getDefaults().isShowHeaders()).isTrue();
}
}

Expand All @@ -243,8 +243,8 @@ void uiConfigIsMappedCorrectly() {
final SpringwolfConfigProperties.UI actual = properties.getUi();

// then
assertThat(actual.isInitiallyShowBindings()).isTrue();
assertThat(actual.isInitiallyShowHeaders()).isTrue();
assertThat(actual.getDefaults().isShowBindings()).isTrue();
assertThat(actual.getDefaults().isShowHeaders()).isTrue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ springwolf.docket.servers.amqp-server.host=${spring.rabbitmq.host}:${spring.rabb
springwolf.plugin.amqp.publishing.enabled=true

# Springwolf ui configuration
springwolf.ui.initially-show-bindings=true
springwolf.ui.initially-show-headers=true
springwolf.ui.defaults.show-bindings=true
springwolf.ui.defaults.show-headers=true

# For debugging purposes
logging.level.io.github.springwolf=DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ springwolf.docket.servers.kafka-server.host=${spring.cloud.stream.binders.kafka.
springwolf.use-fqn=false

# Springwolf ui configuration
springwolf.ui.initially-show-bindings=true
springwolf.ui.initially-show-headers=true
springwolf.ui.defaults.show-bindings=true
springwolf.ui.defaults.show-headers=true

# For debugging purposes
logging.level.io.github.springwolf=DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ springwolf.docket.servers.jms-server.host=${spring.activemq.broker-url}
springwolf.plugin.jms.publishing.enabled=true

# Springwolf ui configuration
springwolf.ui.initially-show-bindings=true
springwolf.ui.initially-show-headers=true
springwolf.ui.defaults.show-bindings=true
springwolf.ui.defaults.show-headers=true

# For debugging purposes
logging.level.io.github.springwolf=DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ springwolf.docket.group-configs[0].group=Only Vehicles
springwolf.docket.group-configs[0].message-name-to-match=.*Vehicle.*

# Springwolf ui configuration
springwolf.ui.initially-show-bindings=true
springwolf.ui.initially-show-headers=true
springwolf.ui.defaults.show-bindings=true
springwolf.ui.defaults.show-headers=true

# Springwolf kafka configuration
springwolf.docket.servers.kafka-server.protocol=kafka
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ springwolf.docket.servers.sns-server.host=http://localhost:4566
springwolf.plugin.sns.publishing.enabled=true

# Springwolf ui configuration
springwolf.ui.initially-show-bindings=true
springwolf.ui.initially-show-headers=true
springwolf.ui.defaults.show-bindings=true
springwolf.ui.defaults.show-headers=true

# For debugging purposes
logging.level.io.github.springwolf=DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ springwolf.docket.servers.sqs-server.host=http://localhost:4566
springwolf.plugin.sqs.publishing.enabled=true

# Springwolf ui configuration
springwolf.ui.initially-show-bindings=true
springwolf.ui.initially-show-headers=true
springwolf.ui.defaults.show-bindings=true
springwolf.ui.defaults.show-headers=true

# For debugging purposes
logging.level.io.github.springwolf=DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ springwolf.plugin.stomp.endpoint.app=/app
springwolf.plugin.stomp.endpoint.user=/user

# Springwolf ui configuration
springwolf.ui.initially-show-bindings=true
springwolf.ui.initially-show-headers=true
springwolf.ui.defaults.show-bindings=true
springwolf.ui.defaults.show-headers=true

# For debugging purposes
logging.level.io.github.springwolf=DEBUG
Loading