Closed
Description
Description
If the first statement in MUT used a static field that should be processed concretely and which is not an enum, the engine emits UtError
because of NullPointerException
produced by environment.state.lastEdge == null
.
To Reproduce
Try to generate a test for such a method:
public static void concreteStaticFieldAsFirstStatement() {
System.out.println(0);
}
Expected behavior
One test is generated, which does nothing:
@Test
@DisplayName("concreteStaticFieldAsFirstStatement: -> PrintStreamPrintln")
public void testConcreteStaticFieldAsFirstStatement_PrintStreamPrintln() {
HelloWorld.concreteStaticFieldAsFirstStatement();
}
**Actual behavior**
One error method is generated:
```java
public void testConcreteStaticFieldAsFirstStatement_errors() {
// Couldn't generate some tests. List of errors:
//
// 1 occurrences of:
// <Throwable with empty message>
}
Environment
Commit c09568f
Java, no mocks.
Additional context
Not applicable
Metadata
Metadata
Assignees
Type
Projects
Status
Done