Skip to content

Commit

Permalink
Explicitly throw AssertionError
Browse files Browse the repository at this point in the history
Otherwise it's confusing to see the "return object" statement, which is there just to pass compilation phase
  • Loading branch information
tsegismont committed Mar 24, 2015
1 parent 20bcefb commit a50b5e0
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.hawkular.metrics.rest

import static org.junit.Assert.assertEquals
import static org.junit.Assert.fail

import java.util.concurrent.atomic.AtomicInteger

Expand Down Expand Up @@ -82,9 +81,8 @@ class RESTTest {
def originalFailureHandler = hawkularMetrics.handler.failure;
hawkularMetrics.handler.failure = defaultFailureHandler;
try {
def object = method(args)
fail("Expected exception to be thrown")
return object
method(args)
throw new AssertionError("Expected exception to be thrown")
} catch (e) {
errorHandler(e)
} finally {
Expand Down

0 comments on commit a50b5e0

Please sign in to comment.