Skip to content

Cannot set static final java.io.InputStream field java.lang.System #458

Closed
@CaelmBleidd

Description

@CaelmBleidd

Description

If we mock java.util.Scanner class, we get exceptions in the concrete executor -- cannot set field (see screenshot below)

To Reproduce

Steps to reproduce the behaviour:

  1. Run any project in IntelliJ Idea
  2. Create a method with scanner usage
  3. Use the plugin to generate tests
  4. Open the generated tests

Expected behaviour

Correctly generated tests for the method

Actual behaviour

Tests containing only exceptions

Visual proofs
image
image

Environment

You need to add java.util.Scanner into the set of classes to mock always (in the settings of UTBot).

Additional context
There is no additional context.

Metadata

Metadata

Labels

comp-symbolic-engineIssue is related to the symbolic execution engine

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions