Skip to content

Commit

Permalink
CAMEL-17436: Disabling health check for single route or consumer is n…
Browse files Browse the repository at this point in the history
…ot possible (#428)
  • Loading branch information
davsclaus committed Jan 5, 2022
1 parent f7f7ae6 commit 2cb8306
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Expand Up @@ -29,10 +29,12 @@
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;

@CamelSpringBootTest
@EnableAutoConfiguration
@SpringBootApplication
@DirtiesContext
@SpringBootTest(
classes = {CamelAutoConfiguration.class, CamelHealthCheckAutoConfiguration.class, DownRoute.class, MyCamelRoute.class},
properties = {"camel.health.config[consumer\\:down-route].parent=consumers",
Expand Down Expand Up @@ -67,7 +69,7 @@ void shouldNotDisableAllConsumersHealthChecks() {
.get()
.matches(hc -> !hc.getConfiguration().isEnabled());

assertThat(registry.getCheck("consumer:route1"))
assertThat(registry.getCheck("consumer:foo-route"))
.as("other route health check is enabled")
.isPresent()
.get()
Expand Down
Expand Up @@ -26,12 +26,14 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
import org.springframework.test.annotation.DirtiesContext;

@CamelSpringBootTest
@EnableAutoConfiguration
@SpringBootApplication
@SpringBootTest(
classes = {CamelAutoConfiguration.class, CamelHealthCheckAutoConfiguration.class, MyCamelRoute.class})
classes = {CamelAutoConfiguration.class, CamelHealthCheckAutoConfiguration.class, MyCamelRoute.class},
properties = {"camel.springboot.java-routes-include-pattern=**/MyCamelRoute*"})
public class CamelHealthTest {

@Autowired
Expand Down
Expand Up @@ -24,6 +24,6 @@ public class MyCamelRoute extends RouteBuilder {

@Override
public void configure() throws Exception {
from("timer:foo").to("log:foo");
from("timer:foo").routeId("foo-route").to("log:foo");
}
}

0 comments on commit 2cb8306

Please sign in to comment.