use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.
the class UpdateCheckerTest method testAlertIsOlderDockerPatch.
@Test
public void testAlertIsOlderDockerPatch() {
UpdateChecker updateChecker = getEmptyUpdateChecker();
UpdateModel updateModel = updateChecker.getUpdateModel("1.0.0", null, "1.0.0.1", null, null);
assertTrue(updateModel.getUpdatable());
}
use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.
the class UpdateCheckerTest method testAlertIsNewerBothSnapshot.
@ParameterizedTest
@ValueSource(strings = { SUFFIX_SNAPSHOT, SUFFIX_SIGQA_1, SUFFIX_OTHER_TEXT })
public void testAlertIsNewerBothSnapshot(String versionSuffix) {
UpdateChecker updateChecker = getEmptyUpdateChecker();
UpdateModel updateModel = updateChecker.getUpdateModel("1.0.0-" + versionSuffix, null, "0.1.0-" + versionSuffix, null, null);
assertFalse(updateModel.getUpdatable());
}
use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.
the class UpdateCheckerTest method testAlertIsOlderSnapshotDockerPatch.
@ParameterizedTest
@ValueSource(strings = { SUFFIX_SNAPSHOT, SUFFIX_SIGQA_1, SUFFIX_OTHER_TEXT })
public void testAlertIsOlderSnapshotDockerPatch(String versionSuffix) {
UpdateChecker updateChecker = getEmptyUpdateChecker();
OffsetDateTime alertTime = DateUtils.createCurrentDateTimestamp();
OffsetDateTime dockerTagDate = alertTime.plusMinutes(80);
UpdateModel updateModel = updateChecker.getUpdateModel("1.0.0-" + versionSuffix, formatDate(alertTime, DOCKER_DATE_FORMAT), "1.0.0.1", formatDate(dockerTagDate, DOCKER_DATE_FORMAT), null);
assertTrue(updateModel.getUpdatable());
}
use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.
the class UpdateCheckerTest method testAlertIsNewerButCloseBothSnapshot.
@ParameterizedTest
@ValueSource(strings = { SUFFIX_SNAPSHOT, SUFFIX_SIGQA_1, SUFFIX_OTHER_TEXT })
public void testAlertIsNewerButCloseBothSnapshot(String versionSuffix) {
UpdateChecker updateChecker = getEmptyUpdateChecker();
OffsetDateTime alertTime = DateUtils.createCurrentDateTimestamp();
OffsetDateTime dockerTagDate = alertTime.minusMinutes(20);
UpdateModel updateModel = updateChecker.getUpdateModel("1.0.0-" + versionSuffix, formatDate(alertTime, DOCKER_DATE_FORMAT), "1.0.0-" + versionSuffix, formatDate(dockerTagDate, DOCKER_DATE_FORMAT), null);
assertFalse(updateModel.getUpdatable());
}
use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.
the class UpdateNotifierTask method runTask.
@Override
public void runTask() {
UpdateModel updateModel = updateChecker.getUpdateModel();
if (updateModel.getUpdatable()) {
addSystemMessage(updateModel.getDockerTagVersion());
updateEmailService.sendUpdateEmail(updateModel);
}
}
Aggregations