Skip to content

Incorrect test class name for deep nested method #1675

Open
@EgorkaKulikov

Description

@EgorkaKulikov

To Reproduce

  1. Consider the following source code:
public class ClassWithStaticAndInnerClasses {
    public int z = 0;

    public static class PublicStaticClassWithPrivateField {

        public static class DeepNestedStatic {
            public int g(int x) {
                return x + 1;
            }
        }

        public class DeepNested {
            public int h(int x) {
                return x + 2;
            }
        }
    }
}
  1. Locate the cursor inside h method.
  2. Generate tests without mocks.

Expected behavior

Generated code is compilable, test class name is correct

Actual behavior

Current test class name leads to compilation errors.

Visual proofs (screenshots, logs, images)

image

Metadata

Metadata

Assignees

Labels

comp-codegenIssue is related to code generatorctg-bugIssue is a buglang-javaIssue is related to Java supportspec-regressionRegression

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions