Skip to content

Commit d2f8cb8

Browse files
authored
Merge pull request #322 from eclipse-jnosql/BUG-585
[BUG] java.time.Instant values cannot be read
2 parents 2378d5f + 69494e2 commit d2f8cb8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

jnosql-couchdb/src/test/java/org/eclipse/jnosql/databases/couchdb/communication/integration/Failure.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
import jakarta.nosql.Entity;
1919
import jakarta.nosql.Id;
2020

21+
import java.time.Instant;
22+
2123
@Entity
2224
public record Failure(
2325
@Id String id,
24-
@Column byte[] data) {
26+
@Column byte[] data,
27+
@Column Instant instant) {
2528

2629
}

jnosql-couchdb/src/test/java/org/eclipse/jnosql/databases/couchdb/communication/integration/TemplateIntegrationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.junit.jupiter.api.Test;
3434
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
3535

36+
import java.time.Instant;
3637
import java.util.List;
3738
import java.util.Optional;
3839

@@ -128,13 +129,14 @@ void shouldDeleteAll(){
128129

129130
@Test
130131
void shouldInsertByteArray() {
131-
var failure = new Failure("test", new byte[]{'a','b','c','d'});
132+
var failure = new Failure("test", new byte[]{'a','b','c','d'}, Instant.now());
132133
template.insert(failure);
133134
Optional<Failure> entity = template.find(Failure.class, "test");
134135
SoftAssertions.assertSoftly(softly -> {
135136
softly.assertThat(entity).isNotNull().isNotEmpty();
136137
softly.assertThat(entity).map(Failure::id).get().isEqualTo("test");
137138
softly.assertThat(entity).map(Failure::data).get().isEqualTo(failure.data());
139+
softly.assertThat(entity).map(Failure::instant).get().isEqualTo(failure.instant());
138140
});
139141
}
140142

0 commit comments

Comments
 (0)