Skip to content

Commit

Permalink
create wicket WicketEndpointRepositoryDefault only on missing bean
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcGiffing committed Dec 21, 2021
1 parent 2ff7aed commit e9846fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.giffing.wicket.spring.boot.starter.configuration.extensions.external.spring.boot.actuator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -9,12 +9,14 @@
@Configuration
public class WicketEndpointConfiguration {

@Autowired
private WicketEndpointRepository repo;

@Bean
public WicketEndpoint wicketEndpoint() {
return new WicketEndpoint(repo);
return new WicketEndpoint(wicketEndpointRepositoryDefault());
}

@Bean
@ConditionalOnMissingBean
public WicketEndpointRepository wicketEndpointRepositoryDefault() {
return new WicketEndpointRepositoryDefault();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.giffing.wicket.spring.boot.context.extensions.boot.actuator.WicketAutoConfig;
import com.giffing.wicket.spring.boot.context.extensions.boot.actuator.WicketEndpointRepository;

@Component
public class WicketEndpointRepositoryDefault implements WicketEndpointRepository {

public List<WicketAutoConfig> wicketAutoConfigurations = new ArrayList<>();
Expand Down

0 comments on commit e9846fa

Please sign in to comment.