test_class.declarator: EXECUTION_HOUR = 4
test_class.modifier: private final
test_class.original_string: private final int EXECUTION_HOUR = 4;
test_class.type: int
test_class.var_name: EXECUTION_HOUR
test_class.declarator: fixedHourJob
test_class.modifier: private
test_class.original_string: private FixedHourJob fixedHourJob;
test_class.type: FixedHourJob
test_class.var_name: fixedHourJob
test_class.declarator: clock
test_class.modifier: private
test_class.original_string: private Clock clock;
test_class.type: Clock
test_class.var_name: clock
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/base/scheduled/FixedHourScheduledJobTest.java
test_class.identifier: FixedHourScheduledJobTest
test_case.body: @Test
      public void shouldUpdateReturnsFalseWhenLastExecuteWasTodayAfterUpdateHour() {
          // given
          var updateHour = 4;
          var instant = Instant.parse("2019-03-14T05:00:00.00Z");
          var zoneId = ZoneId.systemDefault();
          var localClock = Clock.fixed(instant, zoneId);
          var localFixedHourJob = new FixedHourJob(localClock, updateHour);
  
          var lastExecuteTime = LocalDateTime.now(localClock);
  
          // when
          var actualShouldUpdate = localFixedHourJob.shouldExecute(lastExecuteTime);
  
          // then
          assertThat(actualShouldUpdate).isFalse();
      }
test_case.class_method_signature: FixedHourScheduledJobTest.shouldUpdateReturnsFalseWhenLastExecuteWasTodayAfterUpdateHour()
test_case.full_signature: @Test public void shouldUpdateReturnsFalseWhenLastExecuteWasTodayAfterUpdateHour()
test_case.identifier: shouldUpdateReturnsFalseWhenLastExecuteWasTodayAfterUpdateHour
test_case.invocations: parse systemDefault fixed now shouldExecute isFalse assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldUpdateReturnsFalseWhenLastExecuteWasTodayAfterUpdateHour()
focal_class.declarator: clock
focal_class.modifier: protected final
focal_class.original_string: protected final Clock clock;
focal_class.type: Clock
focal_class.var_name: clock
focal_class.declarator: jobExecutionHour
focal_class.modifier: protected final
focal_class.original_string: protected final int jobExecutionHour;
focal_class.type: int
focal_class.var_name: jobExecutionHour
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/base/scheduled/FixedHourScheduledJob.java
focal_class.identifier: FixedHourScheduledJob
focal_class.interfaces: implements ScheduledJob
focal_class.class_method_signature: FixedHourScheduledJob.FixedHourScheduledJob(Clock clock, int jobExecutionHour)
focal_class.full_signature: protected  FixedHourScheduledJob(Clock clock, int jobExecutionHour)
focal_class.identifier: FixedHourScheduledJob
focal_class.modifiers: protected
focal_class.parameters: (Clock clock, int jobExecutionHour)
focal_class.signature:  FixedHourScheduledJob(Clock clock, int jobExecutionHour)
focal_class.class_method_signature: FixedHourScheduledJob.shouldExecute(LocalDateTime lastExecuteTime)
focal_class.full_signature: @Override public final boolean shouldExecute(LocalDateTime lastExecuteTime)
focal_class.identifier: shouldExecute
focal_class.modifiers: @Override public final
focal_class.parameters: (LocalDateTime lastExecuteTime)
focal_class.return: boolean
focal_class.signature: boolean shouldExecute(LocalDateTime lastExecuteTime)
focal_method.body: @Override
      public final boolean shouldExecute(LocalDateTime lastExecuteTime) {
          var now = LocalDateTime.now(clock);
          var today = LocalDate.now(clock);
          var yesterday = today.minus(1, ChronoUnit.DAYS);
          var lastExecuteDate = lastExecuteTime.toLocalDate();
  
          // last execute two days or more ago
          if(yesterday.isAfter(lastExecuteDate)) {
              return true;
  
              // last execute yesterday
          } else if(today.isAfter(lastExecuteDate)) {
              return now.getHour() >= this.jobExecutionHour;
  
              // last execute today
          } else {
              return lastExecuteTime.getHour() < this.jobExecutionHour;
          }
      }
focal_method.class_method_signature: FixedHourScheduledJob.shouldExecute(LocalDateTime lastExecuteTime)
focal_method.full_signature: @Override public final boolean shouldExecute(LocalDateTime lastExecuteTime)
focal_method.identifier: shouldExecute
focal_method.invocations: now now minus toLocalDate isAfter isAfter getHour getHour
focal_method.modifiers: @Override public final
focal_method.parameters: (LocalDateTime lastExecuteTime)
focal_method.return: boolean
focal_method.signature: boolean shouldExecute(LocalDateTime lastExecuteTime)