Skip to content

Add unit tests for JDBCEventQueryDAO, JDBCBrowserLogQueryDAO, and JDBCProfileThreadSnapshotQueryDAO#13802

Merged
wu-sheng merged 6 commits intoapache:masterfrom
currenjin:test/jdbc-event-query-dao
Apr 8, 2026
Merged

Add unit tests for JDBCEventQueryDAO, JDBCBrowserLogQueryDAO, and JDBCProfileThreadSnapshotQueryDAO#13802
wu-sheng merged 6 commits intoapache:masterfrom
currenjin:test/jdbc-event-query-dao

Conversation

@currenjin
Copy link
Copy Markdown
Contributor

@currenjin currenjin commented Apr 7, 2026

What's this PR about?

Adds unit tests for three more JDBC query DAOs to improve test coverage in the storage-jdbc-hikaricp plugin.

  • JDBCEventQueryDAOTest — verifies buildQuery() condition/parameter building (TABLE_COLUMN, uuid, source, eventType)
  • JDBCBrowserLogQueryDAOTest — verifies buildSQL() condition building (TABLE_COLUMN, serviceId, versionId, pagePathId, category, duration, limit)
  • JDBCProfileThreadSnapshotQueryDAOTest — verifies querySegments() SQL structure (TABLE_COLUMN, taskId filter, sequence=0 filter)

Which issue does this PR relate to?

N/A — test coverage improvement for JDBC storage plugin.

Tests

All new. 17 test cases total, all passing locally.

@wu-sheng wu-sheng requested a review from Copilot April 7, 2026 06:31
@wu-sheng wu-sheng added this to the 10.5.0 milestone Apr 7, 2026
@wu-sheng wu-sheng added the test Test requirements about performance, feature or before release. label Apr 7, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds JUnit tests to validate JDBCEventQueryDAO.buildQuery() SQL condition and parameter construction, improving regression protection for JDBC event querying.

Changes:

  • Introduce JDBCEventQueryDAOTest covering mandatory TABLE_COLUMN discriminator behavior.
  • Add test cases for optional filters (UUID, source/service fields, event type).
  • Verify TABLE_COLUMN discriminator isn’t duplicated when additional filters are present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@currenjin currenjin changed the title Add unit tests for JDBCEventQueryDAO SQL building Add unit tests for JDBCEventQueryDAO, JDBCBrowserLogQueryDAO, and JDBCProfileThreadSnapshotQueryDAO Apr 8, 2026
@wu-sheng wu-sheng merged commit ad12d91 into apache:master Apr 8, 2026
417 of 420 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Test requirements about performance, feature or before release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants