Skip to content

Commit

Permalink
self-xdsd#109 Changed AssignedTasks Chron From 6h to 30min.
Browse files Browse the repository at this point in the history
  • Loading branch information
criske committed May 11, 2021
1 parent 8bcf4a8 commit bafc222
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/selfxdsd/selfpm/ReviewAssignedTasks.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class ReviewAssignedTasks {
/**
* The PMs will review the assigned tasks every 6 hours.
*/
private static final int EVERY_6_HOURS = 21600000;
static final String EVERY_30_MINUTES = "PT30M";

/**
* Logger.
Expand All @@ -69,7 +69,7 @@ public ReviewAssignedTasks(final Self selfCode) {
/**
* Every 6 hours the PMs should verify their assigned tasks.
*/
@Scheduled(fixedRate = EVERY_6_HOURS)
@Scheduled(fixedRateString = EVERY_30_MINUTES)
public void reviewAssignedTasks() {
LOG.debug("PMs reviewing their assigned tasks...");
for(final ProjectManager manager : this.selfCore.projectManagers()) {
Expand Down
14 changes: 14 additions & 0 deletions src/test/java/com/selfxdsd/selfpm/ReviewAssignedTasksTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
package com.selfxdsd.selfpm;

import com.selfxdsd.api.*;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.mockito.Mockito;

import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -139,4 +142,15 @@ public void reviewsProjectsWithException() {
}
}

/**
* Review period has correct format.
*/
@Test
public void reviewPeriodHasCorrectFormat() {
MatcherAssert.assertThat(
Duration.parse(ReviewAssignedTasks.EVERY_30_MINUTES),
Matchers.equalTo(Duration.ofMinutes(30))
);
}

}

0 comments on commit bafc222

Please sign in to comment.