2323import org .hamcrest .Matcher ;
2424import org .hamcrest .Matchers ;
2525import static org .hamcrest .Matchers .*;
26- import org .junit .Before ;
2726import org .junit .Rule ;
2827import org .junit .Test ;
2928import static org .junit .internal .matchers .ThrowableMessageMatcher .hasMessage ;
3938 *
4039 * @author Krzysztof Suszyński <krzysztof.suszynski@wavesoftware.pl>
4140 */
41+ @ SuppressWarnings ({"ConstantConditions" , "unused" })
4242public class EidPreconditionsTest {
4343
4444 @ Rule
45- public ExpectedException thrown = ExpectedException .none ();
45+ public final ExpectedException thrown = ExpectedException .none ();
4646
4747 private final String eid = "20150718:075046" ;
4848
49- @ Before
50- public void setUp () throws Exception {
51- }
52-
5349 @ Test
5450 public void testCheckArgument () {
5551 // given
@@ -227,8 +223,8 @@ public String execute() throws InterruptedIOException {
227223 public void testCreate () throws NoSuchMethodException {
228224 // given
229225 Class <EidPreconditions > cls = EidPreconditions .class ;
230- Constructor <?> constr = cls .getDeclaredConstructor ();
231- boolean access = constr .isAccessible ();
226+ Constructor <?> constructor = cls .getDeclaredConstructor ();
227+ boolean access = constructor .isAccessible ();
232228
233229 // then
234230 assertThat (access ).isFalse ();
@@ -237,6 +233,7 @@ public void testCreate() throws NoSuchMethodException {
237233
238234 @ Override
239235 public boolean matches (Object item ) {
236+ @ SuppressWarnings ("ThrowableResultOfMethodCallIgnored" )
240237 Eid eidObject = EidRuntimeException .class .cast (item ).getEid ();
241238 return eidObject .getId ().equals ("20150718:083450" )
242239 && !eidObject .getRef ().isEmpty ()
@@ -406,6 +403,7 @@ public String execute() {
406403 assertThat (result ).isEqualTo (tester );
407404 }
408405
406+ @ SuppressWarnings ("SameReturnValue" )
409407 private Eid getNullEid () {
410408 return null ;
411409 }
0 commit comments