Skip to content

Commit

Permalink
Add further requested improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Merdes authored and mmerdes committed Jul 14, 2017
1 parent 89cc92e commit 976d148
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
*
* <h3>Method Signatures</h3>
*
* <p>{@code @AfterAll} methods must not be {@code private} and must be
* {@code static} by default. Consequently, {@code @AfterAll} methods are not
* {@code @AfterAll} methods must have a {@code void} return type,
* must not be {@code private}, and must be {@code static} by default.
* Consequently, {@code @AfterAll} methods are not
* supported in {@link Nested @Nested} test classes or as <em>interface default
* methods</em> unless the test class is annotated with
* {@link TestInstance @TestInstance(Lifecycle.PER_CLASS)}. {@code @AfterAll}
* methods may optionally declare parameters to be resolved by
* {@link org.junit.jupiter.api.extension.ParameterResolver ParameterResolvers}.
* {@code @AfterAll} methods must not return a value.
*
* <h3>Inheritance</h3>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
*
* <h3>Method Signatures</h3>
*
* <p>{@code @AfterEach} methods must not be {@code private}, must not be
* {@code static}, and may optionally declare parameters to be resolved by
* {@code @AfterEach} methods must have a {@code void} return type,
* must not be {@code private}, and must not be {@code static}.
* They may optionally declare parameters to be resolved by
* {@link org.junit.jupiter.api.extension.ParameterResolver ParameterResolvers}.
* {@code @AfterEach} methods must not return a value.
*
* <h3>Inheritance</h3>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
*
* <h3>Method Signatures</h3>
*
* <p>{@code @BeforeAll} methods must not be {@code private} and must be
* {@code static} by default. Consequently, {@code @BeforeAll} methods are not
* {@code @BeforeAll} methods must have a {@code void} return type,
* must not be {@code private}, and must be {@code static} by default.
* Consequently, {@code @BeforeAll} methods are not
* supported in {@link Nested @Nested} test classes or as <em>interface default
* methods</em> unless the test class is annotated with
* {@link TestInstance @TestInstance(Lifecycle.PER_CLASS)}. {@code @BeforeAll}
* methods may optionally declare parameters to be resolved by
* {@link org.junit.jupiter.api.extension.ParameterResolver ParameterResolvers}.
* {@code @BeforeAll} methods must not return a value.
*
* <h3>Inheritance</h3>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
*
* <h3>Method Signatures</h3>
*
* <p>{@code @BeforeEach} methods must not be {@code private}, must not be
* {@code static}, and may optionally declare parameters to be resolved by
* {@code @BeforeEach} methods must have a {@code void} return type,
* must not be {@code private}, and must not be {@code static}.
* They may optionally declare parameters to be resolved by
* {@link org.junit.jupiter.api.extension.ParameterResolver ParameterResolvers}.
* {@code @BeforeEach} methods must not return a value.
*
* <h3>Inheritance</h3>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

package org.junit.jupiter.engine;

import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
Expand All @@ -21,24 +21,21 @@ class NonVoidTestableMethodIntegrationTests {
void valid() {
}

//this method must never be called
@Test
int invalidMethodReturningPrimitive() {
assertTrue(false);
fail("This method should never have been called.");
return 1;
}

//this method must never be called
@Test
String invalidMethodReturningObject() {
assertTrue(false);
fail("This method should never have been called.");
return "";
}

//this method must never be called
@RepeatedTest(3)
int invalidMethodVerifyingTestTemplateMethod() {
assertTrue(false);
fail("This method should never have been called.");
return 1;
}

Expand Down

0 comments on commit 976d148

Please sign in to comment.