Skip to content

test(jul): [Sample Tests 31] Move the JUL sample's system test into sentry-jul - #6323

Draft
runningcode wants to merge 2 commits into
no/log4j2-integration-testfrom
no/jul-integration-test
Draft

runningcode wants to merge 2 commits into
no/log4j2-integration-testfrom
no/jul-integration-test

Conversation

@runningcode

@runningcode runningcode commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Moves sentry-samples-jul's system test into sentry-jul as SentryHandlerIntegrationTest, the JUL version of #6268 and #6322. As in the sample, LogManager reads a logging properties file, sentry-handler-integration-test.properties with the sample's handler levels, and builds the SentryHandler from it. The test then checks what reaches MockSentryServer:

  • the warning, with its feature flag;
  • the error, with its RuntimeException and the config and info breadcrumbs;
  • the logs, with the scope's attributes.

Three details:

  • DSN: the handler gets it through Sentry's external configuration, as the sample did from sentry.properties, here the sentry.dsn system property. The module's test sentry.properties already enables logs.
  • Logger name: the test logs through com.example.App. SentryHandler drops records from io.sentry loggers so it doesn't capture the SDK's own logs, so a logger named after the test class would send nothing.
  • Global state: readConfiguration replaces the JVM-wide LogManager configuration. The test restores the one the module's other tests read, which also closes its handler.

With no system tests left, the sample comes off the runner and the backend workflow. It also drops the Kotlin plugin, which only the test needed. sentry-jul gets Truth as a test dependency.

💡 Motivation and Context

The JUL handler's LogManager configuration now runs in ./gradlew :sentry-jul:test.

💚 How did you test it?

  • The test passes, and so do the module's other 33 tests next to it, including SentryHandlerTest's LogManager-based test, which runs after it.
  • Expecting a different warning message makes it fail.
  • :sentry-jul:check passes, and the sample's JAR still builds.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The plain console sample: profiling into sentry-async-profiler, Kafka into sentry-kafka.

#skip-changelog

🤖 Generated with Claude Code

Adds SentryHandlerIntegrationTest, which configures the Sentry handler
through a logging properties file read by LogManager, as the sample
does, and checks what reaches MockSentryServer: the warning with its
flag, the error with its exception and breadcrumbs, and the logs with
their attributes. Its logger is outside io.sentry, whose loggers the
handler drops, and the test restores the LogManager configuration the
other tests read.

The sample has no system tests left, so it comes off the system-test
runner and the backend workflow, and drops the Kotlin plugin it only
needed for the test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 20, 2026
@sentry

sentry Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.0 (1) release

⚙️ sentry-android Build Distribution Settings

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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