22
33import com .oembedler .moon .graphql .boot .GraphQLInstrumentationAutoConfiguration ;
44import com .oembedler .moon .graphql .boot .metrics .MetricsInstrumentation ;
5+ import com .oembedler .moon .graphql .boot .metrics .TracingNoResolversInstrumentation ;
56import com .oembedler .moon .graphql .boot .test .AbstractAutoConfigurationTest ;
67import graphql .analysis .MaxQueryComplexityInstrumentation ;
78import graphql .analysis .MaxQueryDepthInstrumentation ;
@@ -49,16 +50,9 @@ public void noDefaultInstrumentations() {
4950 this .getContext ().getBean (Instrumentation .class );
5051 }
5152
52- @ Test (expected = NoSuchBeanDefinitionException .class )
53- public void tracingInstrumentationDisabled () {
54- load (DefaultConfiguration .class , "graphql.servlet.tracingEnabled=false" );
55-
56- this .getContext ().getBean (TracingInstrumentation .class );
57- }
58-
5953 @ Test
6054 public void tracingInstrumentationEnabled () {
61- load (DefaultConfiguration .class , "graphql.servlet.tracingEnabled =true" );
55+ load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled =true" );
6256
6357 Assert .assertNotNull (this .getContext ().getBean (TracingInstrumentation .class ));
6458 }
@@ -78,12 +72,40 @@ public void maxQueryDepthEnabled() {
7872 }
7973
8074 @ Test
81- public void actuatorMetricsEnabled () {
82- load (DefaultConfiguration .class , "graphql.servlet.actuator-metrics=true" );
75+ public void actuatorMetricsEnabledAndTracingEnabled () {
76+ load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=true" , "graphql.servlet. actuator-metrics=true" );
8377
78+ Assert .assertNotNull (this .getContext ().getBean (TracingInstrumentation .class ));
8479 Assert .assertNotNull (this .getContext ().getBean (MetricsInstrumentation .class ));
8580 }
8681
82+ @ Test
83+ public void tracingInstrumentationDisabledndMetricsEnabled () {
84+ load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=false" , "graphql.servlet.actuator-metrics=true" );
85+
86+ Assert .assertNotNull (this .getContext ().getBean (MetricsInstrumentation .class ));
87+ Assert .assertNotNull (this .getContext ().getBean (TracingNoResolversInstrumentation .class ));
88+ }
89+
90+ @ Test (expected = NoSuchBeanDefinitionException .class )
91+ public void tracingInstrumentationEnabledAndMetricsDisabled () {
92+ load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=true" , "graphql.servlet.actuator-metrics=false" );
93+
94+ Assert .assertNotNull (this .getContext ().getBean (TracingInstrumentation .class ));
95+ this .getContext ().getBean (MetricsInstrumentation .class );
96+ }
97+
98+ @ Test (expected = NoSuchBeanDefinitionException .class )
99+ public void tracingInstrumentationDisabledAndMetricsDisabled () {
100+ load (DefaultConfiguration .class , "graphql.servlet.tracing-enabled=false" , "graphql.servlet.actuator-metrics=false" );
101+
102+ this .getContext ().getBean (MetricsInstrumentation .class );
103+ this .getContext ().getBean (TracingNoResolversInstrumentation .class );
104+ this .getContext ().getBean (TracingInstrumentation .class );
105+ }
106+
107+
108+
87109 @ Test (expected = NoSuchBeanDefinitionException .class )
88110 public void actuatorMetricsDisabled () {
89111 load (DefaultConfiguration .class , "graphql.servlet.actuator-metrics=false" );
0 commit comments