Skip to content

Adding config required for SpringBoot docs #1313

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

Merged
merged 1 commit into from
Jul 4, 2022
Merged
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
24 changes: 23 additions & 1 deletion docs/documentation/use-samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Runner {

public static void main(String[] args) {
Operator operator = new Operator(DefaultConfigurationService.instance());
operator.register(new WebServerController());
operator.register(new WebPageReconciler());
operator.start();
}
}
Expand Down Expand Up @@ -214,6 +214,28 @@ public class Application {
}
```

You will also need a `@Configuration` to make sure that your reconciler is registered:

```java

@Configuration
public class Config {

@Bean
public WebPageReconciler customServiceController() {
return new WebPageReconciler();
}

@Bean(initMethod = "start", destroyMethod = "stop")
@SuppressWarnings("rawtypes")
public Operator operator(List<Reconciler> controllers) {
Operator operator = new Operator();
controllers.forEach(operator::register);
return operator;
}
}
```

#### Spring Boot test support

Adding the following dependency would let you mock the operator for the tests where loading the spring container is
Expand Down