Skip to content

Use TIMESTAMP(9) to fix test failures#71

Open
heapifyman wants to merge 1 commit intospring-guides:mainfrom
heapifyman:main
Open

Use TIMESTAMP(9) to fix test failures#71
heapifyman wants to merge 1 commit intospring-guides:mainfrom
heapifyman:main

Conversation

@heapifyman
Copy link
Copy Markdown

@heapifyman heapifyman commented Dec 19, 2025

Test com.example.blog.RepositoriesTests#When findByIdOrNull then return Article fails because h2 truncates the nanoseconds when using the default TIMESTAMP:

expected: Article(title=Lorem, ..., addedAt=2025-12-19T10:06:11.297238501, id=1)
 but was: Article(title=Lorem, ..., addedAt=2025-12-19T10:06:11.297239, id=1)

Test `com.example.blog.RepositoriesTests#When findByIdOrNull then return
Article` fails because h2 truncates the nanoseconds when using the
default `TIMESTAMP`:

```
expected: Article(title=Lorem, headline=Lorem, content=dolor sit amet,
author=IdOnlyAggregateReference{id=1}, slug=lorem,
addedAt=2025-12-19T10:06:11.297238501, id=1)
 but was: Article(title=Lorem, headline=Lorem, content=dolor sit amet,
author=IdOnlyAggregateReference{id=1}, slug=lorem,
addedAt=2025-12-19T10:06:11.297239, id=1)
```

Signed-off-by: heapifyman <274236+heapifyman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant