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.

Update the wiki with "assertThrows"

See original GitHub issue

I think this wiki page https://github.com/junit-team/junit4/wiki/Exception-testing should be updated to mention also the new assertThrows method.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kcooneycommented, Feb 8, 2020

I moved the section about assertThrows() higher up on that wiki page, since that is our current recommended way for testing exceptions. I also added a note that explains why ExpectedExcetpion is deprecated.

1reaction
marcphilippcommented, Feb 8, 2020

@LorenzoBettini Thanks! I added a new section and a short note about ExpectedException now being deprecated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assert.Throws · nunit/docs Wiki - GitHub
Documentation for all active NUnit projects. Contribute to nunit/docs development by creating an account on GitHub.
Read more >
JUnit 5: How to assert an exception is thrown? - Stack Overflow
You can use assertThrows() , which allows you to test multiple exceptions within the same test. With support for lambdas in Java 8,...
Read more >
Module:ScribuntoUnit - Fandom Developers Wiki
function ScribuntoUnit:markTestSkipped( -- begin dev wiki change message ... "unknown error") function ScribuntoUnit:assertThrows(fn, expectedMessage, ...
Read more >
student:junit:v5 [JMU CS Wiki]
There are several ways to test for thrown exceptions in JUnit. The most common is to use the assertThrows() method, but this approach...
Read more >
How to migrate to JUnit 5 - OpenMRS Wiki
openmrs-core TRUNK-5811 - Update Junit from 4 to 5 Closed JUnit 5 tests have ... APIException.class ) with the assertThrows JUnit 4 method....
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