HostRequestLimitPolicy { public boolean isValid(long currentValue) { return currentValue <= limit; } HostRequestLimitPolicy(@Value("${quota.host.limit}") long limit); boolean isValid(long currentValue);  }
@Test public void ifCurrentValueLessThenLimitItIsValid() { assertTrue(limitPolicy.isValid(9)); }
@Test public void ifCurrentValueEqualsToLimitItIsValid() { assertTrue(limitPolicy.isValid(10)); }
@Test public void ifCurrentValueGreaterThenLimitItIsValid() { assertFalse(limitPolicy.isValid(11)); }