CodeQL library for Java/Kotlin
codeql/java-all 4.2.1-dev (changelog, source)
Search

Module Assertions

A library providing uniform access to various assertion frameworks.

Currently supports org.junit.Assert, junit.framework.*, org.junit.jupiter.api.Assertions, com.google.common.base.Preconditions, and java.util.Objects.

Import path

import semmle.code.java.frameworks.Assertions

Imports

java

Provides all default Java QL imports.

Predicates

assertFail

A trivially failing assertion. That is, assert false or its equivalents.

Classes

AssertFailMethod

A method that unconditionally fails.

AssertFalseMethod

A method that asserts that its argument is false.

AssertNotNullMethod

A method that asserts that its argument is not null.

AssertThatMethod

A method that asserts that its first argument has a property given by its second argument.

AssertTrueMethod

A method that asserts that its argument is true.

AssertionMethod

An assertion method.