Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
import jakarta.nosql.Entity;
import jakarta.nosql.Id;

import java.time.Instant;

@Entity
public record Failure(
@Id String id,
@Column byte[] data) {
@Column byte[] data,
@Column Instant instant) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

import java.time.Instant;
import java.util.List;
import java.util.Optional;

Expand Down Expand Up @@ -128,13 +129,14 @@ void shouldDeleteAll(){

@Test
void shouldInsertByteArray() {
var failure = new Failure("test", new byte[]{'a','b','c','d'});
var failure = new Failure("test", new byte[]{'a','b','c','d'}, Instant.now());
template.insert(failure);
Optional<Failure> entity = template.find(Failure.class, "test");
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(entity).isNotNull().isNotEmpty();
softly.assertThat(entity).map(Failure::id).get().isEqualTo("test");
softly.assertThat(entity).map(Failure::data).get().isEqualTo(failure.data());
softly.assertThat(entity).map(Failure::instant).get().isEqualTo(failure.instant());
});
}

Expand Down