11package graphql .kickstart .spring .web .boot .test .instrumentation ;
22
33import graphql .kickstart .spring .web .boot .GraphQLInstrumentationAutoConfiguration ;
4+ import graphql .kickstart .spring .web .boot .GraphQLServletProperties ;
45import graphql .kickstart .spring .web .boot .metrics .MetricsInstrumentation ;
56import graphql .kickstart .spring .web .boot .metrics .TracingNoResolversInstrumentation ;
67import graphql .kickstart .spring .web .boot .test .AbstractAutoConfigurationTest ;
1415import io .micrometer .core .instrument .simple .SimpleMeterRegistry ;
1516import org .junit .jupiter .api .Test ;
1617import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
18+ import org .springframework .boot .context .properties .EnableConfigurationProperties ;
1719import org .springframework .context .annotation .Bean ;
1820import org .springframework .context .annotation .Configuration ;
1921import org .springframework .web .context .support .AnnotationConfigWebApplicationContext ;
2426/**
2527 * @author Marcel Overdijk
2628 */
27- public class GraphQLInstrumentationAutoConfigurationTest extends AbstractAutoConfigurationTest {
29+ class GraphQLInstrumentationAutoConfigurationTest extends AbstractAutoConfigurationTest {
2830
2931 public GraphQLInstrumentationAutoConfigurationTest () {
3032 super (AnnotationConfigWebApplicationContext .class , GraphQLInstrumentationAutoConfiguration .class );
@@ -46,36 +48,36 @@ MeterRegistry meterRegistry() {
4648 }
4749
4850 @ Test
49- public void noDefaultInstrumentations () {
51+ void noDefaultInstrumentations () {
5052 load (DefaultConfiguration .class );
5153
5254 assertThatExceptionOfType (NoSuchBeanDefinitionException .class )
5355 .isThrownBy (() -> this .getContext ().getBean (Instrumentation .class ));
5456 }
5557
5658 @ Test
57- public void tracingInstrumentationEnabled () {
59+ void tracingInstrumentationEnabled () {
5860 load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=true" );
5961
6062 assertThat (this .getContext ().getBean (TracingInstrumentation .class )).isNotNull ();
6163 }
6264
6365 @ Test
64- public void maxQueryComplexityEnabled () {
66+ void maxQueryComplexityEnabled () {
6567 load (DefaultConfiguration .class , "graphql.servlet.maxQueryComplexity=10" );
6668
6769 assertThat (this .getContext ().getBean (MaxQueryComplexityInstrumentation .class )).isNotNull ();
6870 }
6971
7072 @ Test
71- public void maxQueryDepthEnabled () {
73+ void maxQueryDepthEnabled () {
7274 load (DefaultConfiguration .class , "graphql.servlet.maxQueryDepth=10" );
7375
7476 assertThat (this .getContext ().getBean (MaxQueryDepthInstrumentation .class )).isNotNull ();
7577 }
7678
7779 @ Test
78- public void actuatorMetricsEnabledAndTracingEnabled () {
80+ void actuatorMetricsEnabledAndTracingEnabled () {
7981 load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=true" , "graphql.servlet.actuator-metrics=true" );
8082
8183 assertThat (this .getContext ().getBean (MetricsInstrumentation .class )).isNotNull ();
@@ -84,31 +86,31 @@ public void actuatorMetricsEnabledAndTracingEnabled() {
8486 }
8587
8688 @ Test
87- public void tracingInstrumentationDisabledAndMetricsEnabled () {
89+ void tracingInstrumentationDisabledAndMetricsEnabled () {
8890 load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=false" , "graphql.servlet.actuator-metrics=true" );
8991
9092 assertThat (this .getContext ().getBean (MetricsInstrumentation .class )).isNotNull ();
9193 assertThat (this .getContext ().getBean (TracingNoResolversInstrumentation .class )).isNotNull ();
9294 }
9395
9496 @ Test
95- public void tracingMetricsWithTracingDisabled () {
96- load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=' metrics-only' " , "graphql.servlet.actuator-metrics=true" );
97+ void tracingMetricsWithTracingDisabled () {
98+ load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=metrics-only" , "graphql.servlet.actuator-metrics=true" );
9799
98100 assertThat (this .getContext ().getBean ("metricsInstrumentation" )).isNotNull ();
99101 assertThat (this .getContext ().getBean ("tracingInstrumentation" )).isNotNull ();
100102 }
101103
102104 @ Test
103- public void actuatorMetricsEnabled () {
105+ void actuatorMetricsEnabled () {
104106 load (DefaultConfiguration .class , "graphql.servlet.actuator-metrics=true" );
105107
106- assertThat (this .getContext ().getBean (MetricsInstrumentation .class )).isNotNull ();
107108 assertThat (this .getContext ().getBean (TracingNoResolversInstrumentation .class )).isNotNull ();
109+ assertThat (this .getContext ().getBean (MetricsInstrumentation .class )).isNotNull ();
108110 }
109111
110112 @ Test
111- public void tracingInstrumentationEnabledAndMetricsDisabled () {
113+ void tracingInstrumentationEnabledAndMetricsDisabled () {
112114 load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=true" , "graphql.servlet.actuator-metrics=false" );
113115
114116 assertThat (this .getContext ().getBean (TracingInstrumentation .class )).isNotNull ();
@@ -117,7 +119,7 @@ public void tracingInstrumentationEnabledAndMetricsDisabled() {
117119 }
118120
119121 @ Test
120- public void tracingInstrumentationDisabledAndMetricsDisabled () {
122+ void tracingInstrumentationDisabledAndMetricsDisabled () {
121123 load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=false" , "graphql.servlet.actuator-metrics=false" );
122124
123125 assertThatExceptionOfType (NoSuchBeanDefinitionException .class )
@@ -129,7 +131,7 @@ public void tracingInstrumentationDisabledAndMetricsDisabled() {
129131 }
130132
131133 @ Test
132- public void actuatorMetricsDisabled () {
134+ void actuatorMetricsDisabled () {
133135 load (DefaultConfiguration .class , "graphql.servlet.actuator-metrics=false" );
134136
135137 assertThatExceptionOfType (NoSuchBeanDefinitionException .class )
0 commit comments