28
28
import java .util .Collection ;
29
29
import java .util .List ;
30
30
31
- import static org .elasticsearch .index .seqno .SequenceNumbers .UNASSIGNED_SEQ_NO ;
32
31
import static org .hamcrest .Matchers .contains ;
33
32
import static org .hamcrest .Matchers .containsString ;
34
33
import static org .hamcrest .Matchers .empty ;
@@ -53,7 +52,7 @@ public void testEmptyId() {
53
52
}
54
53
55
54
public void testRetainingSequenceNumberOutOfRange () {
56
- final long retainingSequenceNumber = randomLongBetween (Long .MIN_VALUE , UNASSIGNED_SEQ_NO - 1 );
55
+ final long retainingSequenceNumber = randomLongBetween (Long .MIN_VALUE , - 1 );
57
56
final IllegalArgumentException e = expectThrows (
58
57
IllegalArgumentException .class ,
59
58
() -> new RetentionLease ("id" , retainingSequenceNumber , randomNonNegativeLong (), "source" ));
@@ -66,7 +65,7 @@ public void testTimestampOutOfRange() {
66
65
final long timestamp = randomLongBetween (Long .MIN_VALUE , -1 );
67
66
final IllegalArgumentException e = expectThrows (
68
67
IllegalArgumentException .class ,
69
- () -> new RetentionLease ("id" , randomLongBetween ( SequenceNumbers . NO_OPS_PERFORMED , Long . MAX_VALUE ), timestamp , "source" ));
68
+ () -> new RetentionLease ("id" , randomNonNegativeLong ( ), timestamp , "source" ));
70
69
assertThat (e , hasToString (containsString ("retention lease timestamp [" + timestamp + "] out of range" )));
71
70
}
72
71
@@ -87,7 +86,7 @@ public void testEmptySource() {
87
86
88
87
public void testRetentionLeaseSerialization () throws IOException {
89
88
final String id = randomAlphaOfLength (8 );
90
- final long retainingSequenceNumber = randomLongBetween (SequenceNumbers . NO_OPS_PERFORMED , Long .MAX_VALUE );
89
+ final long retainingSequenceNumber = randomLongBetween (0 , Long .MAX_VALUE );
91
90
final long timestamp = randomNonNegativeLong ();
92
91
final String source = randomAlphaOfLength (8 );
93
92
final RetentionLease retentionLease = new RetentionLease (id , retainingSequenceNumber , timestamp , source );
0 commit comments