17 lines
405 B
Plaintext
17 lines
405 B
Plaintext
![]() |
If a ``++RuntimeException++`` is thrown while code is unit tested, it's likely to be thrown again in production. Therefore, test methods should be allowed to \``++throw RuntimeException++``s so you're alerted early to problems in the code.
|
||
|
|
||
|
|
||
|
== Noncompliant Code Example
|
||
|
|
||
|
----
|
||
|
@Test
|
||
|
public void testTheThing() {
|
||
|
try {
|
||
|
// ...
|
||
|
} catch (RuntimeException e) { // Noncompliant
|
||
|
// ...
|
||
|
}
|
||
|
}
|
||
|
----
|
||
|
|