-
Notifications
You must be signed in to change notification settings - Fork 226
Spring MVC Test gives 404 if @EnableMetrics #198
Comments
Same issue for me, someone knows how to fix it? |
Try using: |
@helospark Tried including "proxyTargetClass" the the issue still persists and my Test Cases are failing with below exception:
|
@sripadapavan Based on the error message, it seems like you have a systemPublicMetrics in your metricsConfig class that connot be autowired (have you added that, or does that come from the superclass? If you added manually, can you provide full example?) This indicated that for whatever reason PublicMetricsAutoConfiguration is not invoked while autoconfiguring the context. You can define such a bean by adding to your test It might also worth a look, on why this autoconfiguration is not invoked. Before adding targetProxyClass=true have you also experienced 404 error on controller and no bean creation exception? |
Having @EnableMetrics I get 404 on Controller tests. Commenting out @EnableMetrics brings everything back to normal.
Full test to reproduce the issue below (notice if TestController does not implement anything, test passes):
The text was updated successfully, but these errors were encountered: