• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

valkyrjaio / valkyrja-java / 30417522940
100%

Build:
DEFAULT BRANCH: 26.x
Ran 29 Jul 2026 02:42AM UTC
Jobs 1
Files 659
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Jul 2026 02:41AM UTC coverage: 99.977%. Remained the same
30417522940

push

github

web-flow
[Http] Honor the route handler annotation when collecting attribute routes (#64)

# Description

The attribute route collector ignored the `@RouteHandler` annotation
entirely and always built
a handler that constructed the controller through its no-argument
constructor:

```java
Object instance = clazz.getDeclaredConstructor().newInstance();
return (ResponseContract) method.invoke(instance, container, route);
```

That cannot work for a real controller. The starter application's
`HomeController` takes
`(ServerRequestContract, ResponseFactoryContract)`, so it has no such
constructor, and every
route collected this way failed with:

```
Failed to invoke route handler: app.http.controller.HomeController#welcome
Caused by: java.lang.NoSuchMethodException: app.http.controller.HomeController.<init>()
```

Swapping the construction strategy alone would not have been enough: the
controller's
`welcome()` takes **no arguments**, so `method.invoke(instance,
container, route)` would still
fail on argument count. The annotation is the actual mechanism — it
names the handler, a static
`(ContainerContract, RouteContract)` method (typically on the route
provider) that resolves the
controller from the container itself. PHP does exactly this, taking the
handler straight off the
attribute in `updateHandler`, and Sindri already emits the same handler
into the generated
routing data. Only the runtime collector disagreed.

This makes the collector honor `@RouteHandler` when present, and — for a
controller method that
genuinely is the handler — resolves the controller from the container
rather than reflecting a
constructor, so a controller with dependencies works either way.

Verified against the starter application's real controller: the
attribute-collected `welcome`
route now returns `200 Welcome!` where it previously could not be
invoked at all.

This path is reached in debug mode, and as the no-cache fallback when an
application ships no
generated routing data. Applicat... (continued)

1914 of 1916 branches covered (99.9%)

Branch coverage included in aggregate %.

16 of 16 new or added lines in 1 file covered. (100.0%)

6972 of 6972 relevant lines covered (100.0%)

4.34 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30417522940.1 29 Jul 2026 02:42AM UTC 659
99.98
GitHub Action Run
Source Files on build 30417522940
  • Tree
  • List 659
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #30417522940
  • a875018d on github
  • Prev Build on 26.x (#30416624840)
  • Next Build on 26.x (#30417884481)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc