Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesbusy committed Nov 9, 2024
1 parent 78f8bc6 commit 0207762
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/test/java/hudson/plugins/nextexecutions/NextBuildsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import net.sf.json.JSONObject;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.jvnet.hudson.test.JenkinsRule;
import org.kohsuke.stapler.StaplerRequest;

Expand Down Expand Up @@ -63,16 +62,13 @@ public void testGetName() {
}

@Test
@Disabled("Flaky test")
public void testCompareToWithEqualDates() {
try {
FreeStyleProject project = j.createFreeStyleProject("test");
Calendar date1 = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
date1.set(2024, Calendar.MARCH, 19);
Calendar date2 = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
date2.set(2024, Calendar.MARCH, 19);
NextBuilds nextBuild1 = new NextBuilds(project, date1);
NextBuilds nextBuild2 = new NextBuilds(project, date2);
Calendar date = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
date.set(2024, Calendar.MARCH, 19);
NextBuilds nextBuild1 = new NextBuilds(project, date);
NextBuilds nextBuild2 = new NextBuilds(project, date);
assertEquals(0, nextBuild1.compareTo(nextBuild2));
assertEquals(0, nextBuild1.compareTo("Not an Instance"));
} catch (IOException e) {
Expand Down

0 comments on commit 0207762

Please sign in to comment.