Skip to content

Commit

Permalink
Fix failing tests with dirty class assertion
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Lisowski <[email protected]>
  • Loading branch information
MaciejDromin committed Dec 17, 2023
1 parent 4724230 commit 3fc3ad0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.grpc.auth;

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

import org.junit.jupiter.api.Assertions;
Expand All @@ -19,7 +20,7 @@ public class SecurityEventsValidationFailureTest {
.addClass(SecurityEventObserver.class)
.addPackage(SecuredService.class.getPackage()))
.assertException(throwable -> {
assertTrue(throwable instanceof ConfigurationException);
assertEquals(throwable.getClass().getName(), ConfigurationException.class.getName());
assertTrue(throwable.getMessage().contains("quarkus.security.events.enabled"));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ConfigEnabledFalseAndActiveTrueTest {
.overrideConfigKey("quarkus.hibernate-orm.enabled", "false")
.overrideConfigKey("quarkus.hibernate-orm.active", "true")
.assertException(throwable -> assertThat(throwable)
.isInstanceOf(ConfigurationException.class)
.matches(t -> t.getClass().getName().equals(ConfigurationException.class.getName()))
.hasMessageContaining(
"Hibernate ORM activated explicitly for persistence unit '<default>', but the Hibernate ORM extension was disabled at build time",
"If you want Hibernate ORM to be active at runtime, you must set 'quarkus.hibernate-orm.enabled' to 'true' at build time",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class OpaqueTokenVerificationWithUserInfoValidationTest {
Throwable e = t;
ConfigurationException te = null;
while (e != null) {
if (e instanceof ConfigurationException) {
if (e.getClass().getName().equals(ConfigurationException.class.getName())) {
te = (ConfigurationException) e;
break;
}
Expand Down

0 comments on commit 3fc3ad0

Please sign in to comment.