NoOpQuotaService implements QuotaService, Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { final String property = context.getEnvironment().getProperty("dataset.quota.check.enabled"); return !StringUtils.equals("true", property); }  @PostConstruct void init(); @Override void checkIfAddingSizeExceedsAvailableStorage(long size); @Override boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata); @Override long getAvailableSpace();  }
@Test public void shouldEnableQuotaServiceBecausePropertyIsMissing() { givenQuotaProperty(null); final boolean matches = service.matches(context, null); assertTrue(matches); }
@Test public void shouldEnableQuotaServiceBecausePropertyIsFalse() { givenQuotaProperty("false"); final boolean matches = service.matches(context, null); assertTrue(matches); }
@Test public void shouldDisableQuotaServiceBecausePropertyIsTrue() { givenQuotaProperty("true"); final boolean matches = service.matches(context, null); assertFalse(matches); }