Skip to content

ProcessorTests are currently unable to reload Mapper implementation class #4132

Description

@hduelme

Expected behavior

When a Mapper implementation is loaded in a test like

@ProcessorTest
void someTest() {
    MyMapper mapper = Mappers.getMapper( MyMapper.class );
}

the loaded Mapper should be the one generated by the test. For example the one generated by Eclipse or JDK compiler.

Actual behavior

Currently a Mapper implementation is only loaded once from whatever test run loads it first.
This a limitation of the used class loading.

Steps to reproduce the problem

@ProcessorTest
void someTest() {
    MyMapper mapper = Mappers.getMapper( MyMapper.class );
    System.out.println( mapper.getClass().getProtectionDomain().getCodeSource().getLocation() );
}

You will see that the source code location does not change

MapStruct Version

All versions

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions