@ -47,9 +47,9 @@ public class EndpointEnablementProviderTests {
@Test
@Test
public void cannotDetermineEnablementOfEndpointAll ( ) {
public void cannotDetermineEnablementOfEndpointAll ( ) {
this . thrown . expect ( IllegalArgumentException . class ) ;
this . thrown . expect ( IllegalArgumentException . class ) ;
this . thrown . expectMessage ( "Endpoint id ' all ' is a reserved value and cannot "
this . thrown . expectMessage ( "Endpoint id ' default ' is a reserved value and cannot "
+ "be used by an endpoint" ) ;
+ "be used by an endpoint" ) ;
determineEnablement ( " all ", true ) ;
determineEnablement ( " default ", true ) ;
}
}
@Test
@Test
@ -66,14 +66,14 @@ public class EndpointEnablementProviderTests {
@Test
@Test
public void generalDisabledViaGeneralProperty ( ) {
public void generalDisabledViaGeneralProperty ( ) {
validate ( determineEnablement ( "foo" , true , "endpoints. all .enabled=false") , false ,
validate ( determineEnablement ( "foo" , true , "endpoints. default .enabled=false") , false ,
"found property endpoints. all .enabled") ;
"found property endpoints. default .enabled") ;
}
}
@Test
@Test
public void generalEnabledOverrideViaSpecificProperty ( ) {
public void generalEnabledOverrideViaSpecificProperty ( ) {
validate (
validate (
determineEnablement ( "foo" , true , "endpoints. all .enabled=false",
determineEnablement ( "foo" , true , "endpoints. default .enabled=false",
"endpoints.foo.enabled=true" ) ,
"endpoints.foo.enabled=true" ) ,
true , "found property endpoints.foo.enabled" ) ;
true , "found property endpoints.foo.enabled" ) ;
}
}
@ -104,32 +104,32 @@ public class EndpointEnablementProviderTests {
@Test
@Test
public void generalEnabledOverrideViaGeneralWebProperty ( ) {
public void generalEnabledOverrideViaGeneralWebProperty ( ) {
validate (
validate (
determineEnablement ( "foo" , true , "endpoints. all .enabled=false",
determineEnablement ( "foo" , true , "endpoints. default .enabled=false",
"endpoints. all .web.enabled=true") ,
"endpoints. default .web.enabled=true") ,
true , "found property endpoints. all .web.enabled") ;
true , "found property endpoints. default .web.enabled") ;
}
}
@Test
@Test
public void generalEnabledOverrideViaGeneralJmxProperty ( ) {
public void generalEnabledOverrideViaGeneralJmxProperty ( ) {
validate (
validate (
determineEnablement ( "foo" , true , "endpoints. all .enabled=false",
determineEnablement ( "foo" , true , "endpoints. default .enabled=false",
"endpoints. all .jmx.enabled=true") ,
"endpoints. default .jmx.enabled=true") ,
true , "found property endpoints. all .jmx.enabled") ;
true , "found property endpoints. default .jmx.enabled") ;
}
}
@Test
@Test
public void generalEnabledOverrideViaGeneralAnyProperty ( ) {
public void generalEnabledOverrideViaGeneralAnyProperty ( ) {
validate ( determineEnablement ( "foo" , true , "endpoints. all .enabled=false",
validate ( determineEnablement ( "foo" , true , "endpoints. default .enabled=false",
"endpoints. all.web.enabled=false", "endpoints.all .jmx.enabled=true") ,
"endpoints. default.web.enabled=false", "endpoints.default .jmx.enabled=true") ,
true , "found property endpoints. all .jmx.enabled") ;
true , "found property endpoints. default .jmx.enabled") ;
}
}
@Test
@Test
public void generalDisabledEvenWithEnabledGeneralProperties ( ) {
public void generalDisabledEvenWithEnabledGeneralProperties ( ) {
validate (
validate (
determineEnablement ( "foo" , true , "endpoints. all .enabled=true",
determineEnablement ( "foo" , true , "endpoints. default .enabled=true",
"endpoints. all .web.enabled=true",
"endpoints. default .web.enabled=true",
"endpoints. all .jmx.enabled=true", "endpoints.foo.enabled=false" ) ,
"endpoints. default .jmx.enabled=true", "endpoints.foo.enabled=false" ) ,
false , "found property endpoints.foo.enabled" ) ;
false , "found property endpoints.foo.enabled" ) ;
}
}
@ -141,19 +141,19 @@ public class EndpointEnablementProviderTests {
@Test
@Test
public void generalDisabledByDefaultWithAnnotationFlagEvenWithGeneralProperty ( ) {
public void generalDisabledByDefaultWithAnnotationFlagEvenWithGeneralProperty ( ) {
validate ( determineEnablement ( "bar" , false , "endpoints. all .enabled=true") , false ,
validate ( determineEnablement ( "bar" , false , "endpoints. default .enabled=true") , false ,
"endpoint 'bar' is disabled by default" ) ;
"endpoint 'bar' is disabled by default" ) ;
}
}
@Test
@Test
public void generalDisabledByDefaultWithAnnotationFlagEvenWithGeneralWebProperty ( ) {
public void generalDisabledByDefaultWithAnnotationFlagEvenWithGeneralWebProperty ( ) {
validate ( determineEnablement ( "bar" , false , "endpoints. all .web.enabled=true") ,
validate ( determineEnablement ( "bar" , false , "endpoints. default .web.enabled=true") ,
false , "endpoint 'bar' is disabled by default" ) ;
false , "endpoint 'bar' is disabled by default" ) ;
}
}
@Test
@Test
public void generalDisabledByDefaultWithAnnotationFlagEvenWithGeneralJmxProperty ( ) {
public void generalDisabledByDefaultWithAnnotationFlagEvenWithGeneralJmxProperty ( ) {
validate ( determineEnablement ( "bar" , false , "endpoints. all .jmx.enabled=true") ,
validate ( determineEnablement ( "bar" , false , "endpoints. default .jmx.enabled=true") ,
false , "endpoint 'bar' is disabled by default" ) ;
false , "endpoint 'bar' is disabled by default" ) ;
}
}
@ -217,15 +217,15 @@ public class EndpointEnablementProviderTests {
public void specificDisabledViaGeneralProperty ( ) {
public void specificDisabledViaGeneralProperty ( ) {
validate (
validate (
determineEnablement ( "foo" , true , EndpointType . JMX ,
determineEnablement ( "foo" , true , EndpointType . JMX ,
"endpoints. all .enabled=false") ,
"endpoints. default .enabled=false") ,
false , "found property endpoints. all .enabled") ;
false , "found property endpoints. default .enabled") ;
}
}
@Test
@Test
public void specificEnabledOverrideViaEndpointProperty ( ) {
public void specificEnabledOverrideViaEndpointProperty ( ) {
validate (
validate (
determineEnablement ( "foo" , true , EndpointType . WEB ,
determineEnablement ( "foo" , true , EndpointType . WEB ,
"endpoints. all .enabled=false", "endpoints.foo.enabled=true" ) ,
"endpoints. default .enabled=false", "endpoints.foo.enabled=true" ) ,
true , "found property endpoints.foo.enabled" ) ;
true , "found property endpoints.foo.enabled" ) ;
}
}
@ -249,24 +249,24 @@ public class EndpointEnablementProviderTests {
public void specificEnabledOverrideViaGeneralWebProperty ( ) {
public void specificEnabledOverrideViaGeneralWebProperty ( ) {
validate (
validate (
determineEnablement ( "foo" , true , EndpointType . WEB ,
determineEnablement ( "foo" , true , EndpointType . WEB ,
"endpoints. all.enabled=false", "endpoints.all .web.enabled=true") ,
"endpoints. default.enabled=false", "endpoints.default .web.enabled=true") ,
true , "found property endpoints. all .web.enabled") ;
true , "found property endpoints. default .web.enabled") ;
}
}
@Test
@Test
public void specificEnabledOverrideHasNoEffectWithUnrelatedTechProperty ( ) {
public void specificEnabledOverrideHasNoEffectWithUnrelatedTechProperty ( ) {
validate (
validate (
determineEnablement ( "foo" , true , EndpointType . JMX ,
determineEnablement ( "foo" , true , EndpointType . JMX ,
"endpoints. all.enabled=false", "endpoints.all .web.enabled=true") ,
"endpoints. default.enabled=false", "endpoints.default .web.enabled=true") ,
false , "found property endpoints. all .enabled") ;
false , "found property endpoints. default .enabled") ;
}
}
@Test
@Test
public void specificDisabledWithEndpointPropertyEvenWithEnabledGeneralProperties ( ) {
public void specificDisabledWithEndpointPropertyEvenWithEnabledGeneralProperties ( ) {
validate (
validate (
determineEnablement ( "foo" , true , EndpointType . WEB ,
determineEnablement ( "foo" , true , EndpointType . WEB ,
"endpoints. all.enabled=true", "endpoints.all .web.enabled=true",
"endpoints. default.enabled=true", "endpoints.default .web.enabled=true",
"endpoints. all .jmx.enabled=true", "endpoints.foo.enabled=false" ) ,
"endpoints. default .jmx.enabled=true", "endpoints.foo.enabled=false" ) ,
false , "found property endpoints.foo.enabled" ) ;
false , "found property endpoints.foo.enabled" ) ;
}
}
@ -274,8 +274,8 @@ public class EndpointEnablementProviderTests {
public void specificDisabledWithTechPropertyEvenWithEnabledGeneralProperties ( ) {
public void specificDisabledWithTechPropertyEvenWithEnabledGeneralProperties ( ) {
validate (
validate (
determineEnablement ( "foo" , true , EndpointType . WEB ,
determineEnablement ( "foo" , true , EndpointType . WEB ,
"endpoints. all.enabled=true", "endpoints.all .web.enabled=true",
"endpoints. default.enabled=true", "endpoints.default .web.enabled=true",
"endpoints. all .jmx.enabled=true", "endpoints.foo.enabled=true" ,
"endpoints. default .jmx.enabled=true", "endpoints.foo.enabled=true" ,
"endpoints.foo.web.enabled=false" ) ,
"endpoints.foo.web.enabled=false" ) ,
false , "found property endpoints.foo.web.enabled" ) ;
false , "found property endpoints.foo.web.enabled" ) ;
}
}
@ -290,7 +290,7 @@ public class EndpointEnablementProviderTests {
public void specificDisabledByDefaultWithAnnotationFlagEvenWithGeneralProperty ( ) {
public void specificDisabledByDefaultWithAnnotationFlagEvenWithGeneralProperty ( ) {
validate (
validate (
determineEnablement ( "bar" , false , EndpointType . WEB ,
determineEnablement ( "bar" , false , EndpointType . WEB ,
"endpoints. all .enabled=true") ,
"endpoints. default .enabled=true") ,
false , "endpoint 'bar' (web) is disabled by default" ) ;
false , "endpoint 'bar' (web) is disabled by default" ) ;
}
}
@ -298,7 +298,7 @@ public class EndpointEnablementProviderTests {
public void specificDisabledByDefaultWithAnnotationFlagEvenWithGeneralWebProperty ( ) {
public void specificDisabledByDefaultWithAnnotationFlagEvenWithGeneralWebProperty ( ) {
validate (
validate (
determineEnablement ( "bar" , false , EndpointType . WEB ,
determineEnablement ( "bar" , false , EndpointType . WEB ,
"endpoints. all .web.enabled=true") ,
"endpoints. default .web.enabled=true") ,
false , "endpoint 'bar' (web) is disabled by default" ) ;
false , "endpoint 'bar' (web) is disabled by default" ) ;
}
}
@ -306,7 +306,7 @@ public class EndpointEnablementProviderTests {
public void specificDisabledByDefaultWithAnnotationFlagEvenWithGeneralJmxProperty ( ) {
public void specificDisabledByDefaultWithAnnotationFlagEvenWithGeneralJmxProperty ( ) {
validate (
validate (
determineEnablement ( "bar" , false , EndpointType . WEB ,
determineEnablement ( "bar" , false , EndpointType . WEB ,
"endpoints. all .jmx.enabled=true") ,
"endpoints. default .jmx.enabled=true") ,
false , "endpoint 'bar' (web) is disabled by default" ) ;
false , "endpoint 'bar' (web) is disabled by default" ) ;
}
}