question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quarkus Test doesn't have compatibility with PIT

See original GitHub issue

I’ve been creating a back-end service with Quarkus (tests in JUnit/PIT) and I’m not having a good experience with mutation testing (specifically with the first mutant I have to kill). The mutant is: replaced return value with null for org/company/controller/UserController::getUserInformations → SURVIVED.

Controller

@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public UserInformations getUserInformations(String userId) {
    return service.getUserInformations(userId);
}

I have some unit tests to this controller method. Thinking about the null mutant, I just added a Assertions.assertNotNull(userObject) in one of these tests. But, this isn’t working at all. So, how can I kill the mutant?

By the way, I’ve already ensured that the tests in question are being executed in the footer of the execution report:

footer screenshot

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

0reactions
hcolescommented, May 21, 2022

@gdcmarinho No problem, it was an interesting one. I suspect there are other test runners out there that have a similar problem that hasn’t been reported. Unfortunately I couldn’t find a clean general soloution to this, so if any more are identified, the code will have to be updated to recognise them and apply the fix.

Closing as fixed in 1.8.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing Your Application - Quarkus
So far we have only covered integration style tests that test the app via HTTP endpoints, but what if we want to do...
Read more >
Measuring the coverage of your tests - Quarkus
Learn how to measure the test coverage of your application. This guide covers: ... Having completed the Testing your application guide ...
Read more >
Continuous Testing - Quarkus
Quarkus supports continuous testing, where tests run immediately after code changes have been saved. This allows you to get instant feedback on your...
Read more >
Quarkus now supports test profiles
With the release of Quarkus 1.6 Quarkus now supports test profiles, allowing you to easily test multiple different configurations inside the ...
Read more >
Security Testing - Quarkus
Test Security Extension ... This artifact provides the io.quarkus.test.security.TestSecurity annotation, that can be applied to test methods and test classes to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found