fixing inconsistency for data = null in device registry table: adding…#3708
Open
DominikBasnerSotec wants to merge 6 commits intoeclipse-hono:masterfrom
Open
fixing inconsistency for data = null in device registry table: adding…#3708DominikBasnerSotec wants to merge 6 commits intoeclipse-hono:masterfrom
DominikBasnerSotec wants to merge 6 commits intoeclipse-hono:masterfrom
Conversation
Contributor
|
@mattkaem would you mind taking a look? This seems to fall into your area of expertise ... |
mattkaem
reviewed
Nov 21, 2025
Comment on lines
238
to
240
| final var preparedQueryMock = mock(io.vertx.sqlclient.PreparedQuery.class); | ||
| when(preparedQueryMock.execute(any(Tuple.class))).thenReturn(Future.succeededFuture(rowSet)); | ||
| when(sqlConnection.preparedQuery(anyString())).thenReturn(preparedQueryMock); |
Contributor
There was a problem hiding this comment.
I think this should be moved into a private method since it is replicated multiple times in this class. WDYT?
Contributor
Author
There was a problem hiding this comment.
done the cleanup
sophokles73
reviewed
Jan 2, 2026
Comment on lines
+69
to
+70
| private final String TENANT_ID = "test-tenant"; | ||
| private final String DEVICE_ID = "device-1"; |
Contributor
There was a problem hiding this comment.
Suggested change
| private final String TENANT_ID = "test-tenant"; | |
| private final String DEVICE_ID = "device-1"; | |
| private static final String TENANT_ID = "test-tenant"; | |
| private static final String DEVICE_ID = "device-1"; |
And these should be moved to the top of the field declarations
Comment on lines
+69
to
+77
| final Statement statement = Statement.statement(""" | ||
| UPDATE devices | ||
| SET | ||
| data=:data::jsonb, | ||
| version=:next_version | ||
| WHERE | ||
| tenant_id=:tenant_id | ||
| AND | ||
| device_id=:device_id"""); |
| return Future.succeededFuture(Optional.empty()); | ||
| case 1: | ||
| final var entry = entries.get(0); | ||
| final var deviceJson = entry.getString("data") != null ? entry.getString("data") : "{}"; |
Contributor
There was a problem hiding this comment.
Suggested change
| final var deviceJson = entry.getString("data") != null ? entry.getString("data") : "{}"; | |
| final var deviceJson = Optional.ofNullable(entry.getString("data")).orElse("{}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… null handling and tests