Skip to content

Commit

Permalink
Use Hamcrest assertions instead of JUnit in common/common (#1749) (#4886
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Captain1653 committed Sep 15, 2022
1 parent b2cdcef commit d23abf4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions common/common/src/test/java/io/helidon/common/ErrorsTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021 Oracle and/or its affiliates.
* Copyright (c) 2017, 2022 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,7 +34,7 @@ class ErrorsTest {
private static final Logger LOGGER = Logger.getLogger(ErrorsTest.class.getName());

private static void assertErrorMessage(Optional<Errors.ErrorMessage> actual, String expected, String message) {
assertThat(actual, not(Optional.empty()));
assertThat(message, actual, not(Optional.empty()));
assertThat(actual.get().getMessage(), is(expected));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021 Oracle and/or its affiliates.
* Copyright (c) 2019, 2022 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,9 +18,9 @@

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.hamcrest.MatcherAssert.assertThat;

/**
* Unit tests for class {@link GenericTypeUtil}.
Expand All @@ -34,14 +34,14 @@ public class GenericTypeUtilTest{
public void testRawClass() {
Class<?> claszResult = GenericTypeUtil.rawClass(Object.class);

assertFalse(claszResult.isInterface());
assertFalse(claszResult.isArray());
assertEquals("class java.lang.Object", claszResult.toString());
assertEquals(1, claszResult.getModifiers());
assertFalse(claszResult.isEnum());
assertFalse(claszResult.isSynthetic());
assertFalse(claszResult.isAnnotation());
assertFalse(claszResult.isPrimitive());
assertThat(claszResult.isInterface(), is(false));
assertThat(claszResult.isArray(), is(false));
assertThat(claszResult.toString(), is("class java.lang.Object"));
assertThat(claszResult.getModifiers(), is(1));
assertThat(claszResult.isEnum(), is(false));
assertThat(claszResult.isSynthetic(), is(false));
assertThat(claszResult.isAnnotation(), is(false));
assertThat(claszResult.isPrimitive(), is(false));
}

@Test
Expand Down

0 comments on commit d23abf4

Please sign in to comment.