/** * Adds a test method into the list of <test-method> tags. * * @param testMethod the test method. * @return true if added sucessfully, otherwise false. */ public boolean addTestMethod(TestMethod testMethod) { for (TestMethod method : this.testMethods) { if (method.equals(testMethod)) { if ((Statuses.get(testMethod.getStatus()) == Statuses.FAIL) || (Statuses.get(testMethod.getStatus()) == Statuses.SKIP)) { method.setStatus(testMethod.getStatus()); } } } return this.testMethods.add(testMethod); }
@Test @SuppressWarnings("ThrowableResultOfMethodCallIgnored") public void create_invalid_argument_status_exception() { final IllegalArgumentException exception = new IllegalArgumentException(""); final StatusRuntimeException statusRuntimeException = Statuses.invalidArgumentWithCause(exception); assertEquals(exception, statusRuntimeException.getCause()); assertEquals(Status.INVALID_ARGUMENT.getCode(), statusRuntimeException.getStatus().getCode()); }