Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7940737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:27:59+00:00 2026-06-03T23:27:59+00:00

I have recently discovered Spring project for MVC testing: spring-test-mvc . It’s a great

  • 0

I have recently discovered Spring project for MVC testing: spring-test-mvc. It’s a great tool, and I plan to use it more in the future.

However I have noticed a problem with it on my Jenkins CI. The problem is that while MVC integration tests are passing locally, and even on Jenkins CI job, the problem occurs in the Jenkins’ Sonar plugin execution. In this case all asserts done with “.andExpect()” method I tried fail. Yes, they pass if Sonar plugin is not used.

For example

this.mockMvc.perform(get("/someController/some.action").param("someParam", "someValue"))
    .andExpect(status().isOk())
    .andExpect(content().type(MediaType.APPLICATION_JSON))
        .andExpect(request().sessionAttribute("someAttribute", notNullValue()));

In the above test content type and session attribute assertions are failing.
Any ideas? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:28:00+00:00Added an answer on June 3, 2026 at 11:28 pm

    The problem is solved by kind people from spring-mvc. More details can be found on the provided link. In short, in my case Sonar uses Cobertura for coverage testing.

    Cobertura adds the interface HasBeenInstrumented and because of that
    the class is decorated as a JDK dynamic proxy instead, which means a
    synthetic proxy class with one interface that’s not very helpful since
    it’s a Cobertura marker interface. As a result and the controller can
    never and no annotations can be properly discovered.

    The problem is solved by adding proxy-target-class="true" to <tx:annotation-driven> element

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently discovered the ability to use WHERE clauses within indexes in SQL
I've recently discovered that MVC is supposed to have two different flavors, model one
I'm using libsvm library in my project and have recently discovered that it provides
I have recently discovered the excellent library boost::accumulators, and I would like to use
I have recently discovered LINQ and I find it very interesting to use. Currently
I have recently discovered that I am affected by this bug http://www.mail-archive.com/mono-bugs@lists.ximian.com/msg71515.html Well, at
I recently discovered that when you have a page set to session readonly and
I have recently upgraded my ASP.NET MVC application from beta to version 1. And
I have recently found myself becoming more negative about EF and cannot help wondering
I have just recently discovered the difference between different constructors in GDI+. Going: var

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.