Skip to content

Predicate.not() method support is needed #555

Closed
@alisevych

Description

@alisevych

Description

In Java 11 there is a new static method introduced: Predicate.not()
Add its support for test generation.

To Reproduce

Steps to reproduce the behavior:

  1. Set useFuzzing=false in settings.properties
  2. A project with JDK 11 is opened in IntelliJ IDEA
  3. Add the following Java class to it:
import java.util.function.Predicate;

public class test {

    public boolean testIsEqual(int a) {
        if (Predicate.isEqual(5).test(a)) {
            return true;
        } else {
            return false;
        }
    }

    public boolean testNot(int a) {
        if (Predicate.not(i -> i.equals(5)).test(a)) {
            return true;
        } else {
            return false;
        }
    }
}
  1. Create tests with UTBot... for testIsEqual
  2. Create tests with UTBot... for testNot

Expected behavior

4,5 Tests are generated successfully

Actual behavior

  1. Tests are generated
  2. Failed to generate tests error dialog is displayed.

Environment

IDEA 2022.1.3
Gradle project with JDK 11

Metadata

Metadata

Labels

ctg-bugIssue is a bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions