Skip to content

No generated test cases for string concatenation #2241

Open
@mmvpm

Description

@mmvpm

Description

No tests were generated for the class:

public class Example {
    public void bad(String data) {
        String result = data + ";";
    }
}

To Reproduce

Steps to reproduce the behavior:

  1. Create a new Maven project
  2. Paste the code above there
  3. Disable fizzing (symbolic execution 100%)
  4. Run test generation with Do not mock, 60 sec

Expected behavior

Tests are supposed to be generated.

Actual behavior

image

Additional context

After the scenario above:

  1. Run test generation with Mock everything outside the class and Mock static methods
  2. Tests are generated successfully
  3. Again run generation with Do not mock
  4. Now tests are generated successfully too

Possible reason

ApplicationContext.staticsMockingIsConfigured affects UtMock, but shouldn't

Related code

  • org/utbot/engine/Traverser.kt:1421
  • org/utbot/engine/Mocks.kt:233
  • org/utbot/engine/Mocks.kt:240

Metadata

Metadata

Assignees

Labels

comp-symbolic-engineIssue is related to the symbolic execution enginectg-bugIssue is a bug

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions