fixed updating entry with old telemetry
This commit is contained in:
parent
9567e9e0ce
commit
d8a7f97397
@ -107,7 +107,7 @@ public class SingleValueArgumentEntry implements ArgumentEntry {
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateEntry(ArgumentEntry entry) {
|
public boolean updateEntry(ArgumentEntry entry) {
|
||||||
if (entry instanceof SingleValueArgumentEntry singleValueEntry) {
|
if (entry instanceof SingleValueArgumentEntry singleValueEntry) {
|
||||||
if (singleValueEntry.getTs() == this.ts) {
|
if (singleValueEntry.getTs() <= this.ts) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ public class SingleValueArgumentEntryTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdateEntryWithThaSameTs() {
|
void testUpdateEntryWithTheSameTs() {
|
||||||
assertThat(entry.updateEntry(new SingleValueArgumentEntry(ts, new LongDataEntry("key", 13L), 363L))).isFalse();
|
assertThat(entry.updateEntry(new SingleValueArgumentEntry(ts, new LongDataEntry("key", 13L), 363L))).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,6 +81,11 @@ public class SingleValueArgumentEntryTest {
|
|||||||
assertThat(entry.updateEntry(new SingleValueArgumentEntry(ts + 18, new LongDataEntry("key", 11L), 364L))).isTrue();
|
assertThat(entry.updateEntry(new SingleValueArgumentEntry(ts + 18, new LongDataEntry("key", 11L), 364L))).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testUpdateEntryWithOldTs() {
|
||||||
|
assertThat(entry.updateEntry(new SingleValueArgumentEntry(ts - 10, new LongDataEntry("key", 14L), 365L))).isFalse();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testToTbelCfArgWhenJsonIsObject() {
|
void testToTbelCfArgWhenJsonIsObject() {
|
||||||
entry = new SingleValueArgumentEntry(ts, new JsonDataEntry("key", "{\"test\": 10}"), 370L);
|
entry = new SingleValueArgumentEntry(ts, new JsonDataEntry("key", "{\"test\": 10}"), 370L);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user