Search in sources :

Example 11 with UpdateModel

use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.

the class UpdateCheckerTest method testAlertIsOlderButCloseBothSnapshot.

@ParameterizedTest
@ValueSource(strings = { SUFFIX_SNAPSHOT, SUFFIX_SIGQA_1, SUFFIX_OTHER_TEXT })
public void testAlertIsOlderButCloseBothSnapshot(String versionSuffix) {
    UpdateChecker updateChecker = getEmptyUpdateChecker();
    OffsetDateTime alertTime = DateUtils.createCurrentDateTimestamp();
    OffsetDateTime dockerTagDate = alertTime.plusMinutes(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());
}
Also used : OffsetDateTime(java.time.OffsetDateTime) UpdateModel(com.synopsys.integration.alert.update.model.UpdateModel) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 12 with UpdateModel

use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.

the class UpdateCheckerTest method testAlertIsNewer.

@Test
public void testAlertIsNewer() {
    UpdateChecker updateChecker = getEmptyUpdateChecker();
    UpdateModel updateModel = updateChecker.getUpdateModel("1.0.0", null, "0.1.0", null, null);
    assertFalse(updateModel.getUpdatable());
}
Also used : UpdateModel(com.synopsys.integration.alert.update.model.UpdateModel) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 13 with UpdateModel

use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.

the class UpdateCheckerTest method testAlertIsSame.

@Test
public void testAlertIsSame() {
    UpdateChecker updateChecker = getEmptyUpdateChecker();
    UpdateModel updateModel = updateChecker.getUpdateModel("1.0.0", null, "1.0.0", null, null);
    assertFalse(updateModel.getUpdatable());
}
Also used : UpdateModel(com.synopsys.integration.alert.update.model.UpdateModel) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 14 with UpdateModel

use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.

the class UpdateCheckerTest method testAlertIsOlder.

@Test
public void testAlertIsOlder() {
    UpdateChecker updateChecker = getEmptyUpdateChecker();
    UpdateModel updateModel = updateChecker.getUpdateModel("1.0.0", null, "1.0.1", null, null);
    assertTrue(updateModel.getUpdatable());
}
Also used : UpdateModel(com.synopsys.integration.alert.update.model.UpdateModel) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 15 with UpdateModel

use of com.synopsys.integration.alert.update.model.UpdateModel in project hub-alert by blackducksoftware.

the class UpdateCheckerTest method testAlertIsNewerSnapshot.

@ParameterizedTest
@ValueSource(strings = { SUFFIX_SNAPSHOT, SUFFIX_SIGQA_1, SUFFIX_OTHER_TEXT })
public void testAlertIsNewerSnapshot(String versionSuffix) {
    UpdateChecker updateChecker = getEmptyUpdateChecker();
    UpdateModel updateModel = updateChecker.getUpdateModel("1.0.0-" + versionSuffix, null, "0.1.0", null, null);
    assertFalse(updateModel.getUpdatable());
}
Also used : UpdateModel(com.synopsys.integration.alert.update.model.UpdateModel) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

UpdateModel (com.synopsys.integration.alert.update.model.UpdateModel)20 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)19 ValueSource (org.junit.jupiter.params.provider.ValueSource)13 OffsetDateTime (java.time.OffsetDateTime)10 Test (org.junit.jupiter.api.Test)6 AlertProperties (com.synopsys.integration.alert.common.AlertProperties)1 AlertWebServerUrlManager (com.synopsys.integration.alert.common.rest.AlertWebServerUrlManager)1 ProxyManager (com.synopsys.integration.alert.common.rest.proxy.ProxyManager)1 DefaultSystemStatusAccessor (com.synopsys.integration.alert.database.api.DefaultSystemStatusAccessor)1 TestTags (com.synopsys.integration.alert.test.common.TestTags)1 AboutReader (com.synopsys.integration.alert.web.api.about.AboutReader)1 DescriptorMetadataActions (com.synopsys.integration.alert.web.api.metadata.DescriptorMetadataActions)1 DescriptorsResponseModel (com.synopsys.integration.alert.web.api.metadata.model.DescriptorsResponseModel)1 Tags (org.junit.jupiter.api.Tags)1