Skip to content

Generated code tries to use private class as a type #528

Description

@sofurihafe

Description

Generated code tries to use private class as a type for expectedResult argument.

To Reproduce

  1. Generate parametrized tests for VoidStaticMethodsTest from utbot-samples.

Actual behavior

ClassWithStaticAndInnerClasses.PrivateInnerClassWithPrivateField type for expectedResult in arguments cannot be accessed because it's private.

@ParameterizedTest@MethodSource("provideDataForUsePrivateInnerClassWithPrivateField")
publicvoidparameterizedTestsForUsePrivateInnerClassWithPrivateField(
ClassWithStaticAndInnerClassesclassWithStaticAndInnerClasses,
intint1,
ClassWithStaticAndInnerClasses.PrivateInnerClassWithPrivateFieldexpectedResult,
Class<Throwable> expectedError
) throwsIllegalAccessException, NoSuchFieldException {
<...>
}

Metadata

Metadata

Labels

comp-codegenIssue is related to code generatorctg-bugIssue is a bug

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions