Improve test coverage of PropertiesMeterFilter

Closes gh-14689
This commit is contained in:
Andy Wilkinson 2018-10-05 08:36:00 +01:00
parent 171f78a9ce
commit e7f100d5d7
1 changed files with 8 additions and 0 deletions

View File

@ -71,6 +71,14 @@ public class PropertiesMeterFilterTests {
.isEqualTo(MeterFilterReply.NEUTRAL);
}
@Test
public void acceptWhenHasNoMatchingEnabledPropertyShouldReturnNeutral() {
PropertiesMeterFilter filter = new PropertiesMeterFilter(
createProperties("enable.something.else=false"));
assertThat(filter.accept(createMeterId("spring.boot")))
.isEqualTo(MeterFilterReply.NEUTRAL);
}
@Test
public void acceptWhenHasEnableFalseShouldReturnDeny() {
PropertiesMeterFilter filter = new PropertiesMeterFilter(