@Test public void testDayOfWeekDeny() { SecurityTime time = SecurityTime.builder() .value(ChronoField.HOUR_OF_DAY, 12) .value(ChronoField.MINUTE_OF_HOUR, 15) .value(ChronoField.DAY_OF_WEEK, DayOfWeek.SUNDAY.getValue()) .build(); Errors.Collector collector = Errors.collector(); SecurityEnvironment env = SecurityEnvironment.builder() .time(time) .build(); ProviderRequest request = mock(ProviderRequest.class); when(request.env()).thenReturn(env); validator.validate(timeConfig, collector, request); if (collector.collect().isValid()) { fail("Should have failed, as 12:15 is not in supported times"); } }
@Override public void validate(TimeConfig config, Errors.Collector collector, ProviderRequest request) { ZonedDateTime now = request.env().time(); config.validate(this, now, collector); }
TimeValidator implements AbacValidator<TimeValidator.TimeConfig> { @Override public void validate(TimeConfig config, Errors.Collector collector, ProviderRequest request) { ZonedDateTime now = request.env().time(); config.validate(this, now, collector); } }
TimeValidator implements AbacValidator<TimeValidator.TimeConfig> { @Override public void validate(TimeConfig config, Errors.Collector collector, ProviderRequest request) { ZonedDateTime now = request.env().time(); config.validate(this, now, collector); } private  TimeValidator(); }
TimeValidator implements AbacValidator<TimeValidator.TimeConfig> { @Override public void validate(TimeConfig config, Errors.Collector collector, ProviderRequest request) { ZonedDateTime now = request.env().time(); config.validate(this, now, collector); } private  TimeValidator(); static TimeValidator create(); @Override Class<TimeConfig> configClass(); @Override String configKey(); @Override TimeConfig fromConfig(Config config); @Override TimeConfig fromAnnotations(EndpointConfig endpointConfig); @Override void validate(TimeConfig config, Errors.Collector collector, ProviderRequest request); @Override Collection<Class<? extends Annotation>> supportedAnnotations(); }
TimeValidator implements AbacValidator<TimeValidator.TimeConfig> { @Override public void validate(TimeConfig config, Errors.Collector collector, ProviderRequest request) { ZonedDateTime now = request.env().time(); config.validate(this, now, collector); } private  TimeValidator(); static TimeValidator create(); @Override Class<TimeConfig> configClass(); @Override String configKey(); @Override TimeConfig fromConfig(Config config); @Override TimeConfig fromAnnotations(EndpointConfig endpointConfig); @Override void validate(TimeConfig config, Errors.Collector collector, ProviderRequest request); @Override Collection<Class<? extends Annotation>> supportedAnnotations();  }