Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.mapstruct.ap.test.bugs._3732;

import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

@Mapper
public interface Issue3732Mapper {

Issue3732Mapper INSTANCE = Mappers.getMapper( Issue3732Mapper.class );

ModelB map(ModelA model);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.mapstruct.ap.test.bugs._3732;

import org.mapstruct.ap.testutil.IssueKey;
import org.mapstruct.ap.testutil.ProcessorTest;
import org.mapstruct.ap.testutil.WithClasses;

import java.time.LocalDateTime;

import static org.assertj.core.api.Assertions.assertThat;

@WithClasses({
Issue3732Mapper.class,
ModelA.class,
ModelB.class,
})
@IssueKey("3732")
public class Issue3732Test {

@ProcessorTest(org.mapstruct.ap.testutil.runner.Compiler.JDK)
public void testUnusedImport() {
ModelA source = new ModelA();
source.setDatetime( LocalDateTime.now() );

ModelB target = Issue3732Mapper.INSTANCE.map( source );

assertThat( target.getDatetime() ).isNotNull();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.mapstruct.ap.test.bugs._3732;

import java.time.LocalDateTime;

public class ModelA {
private LocalDateTime datetime;

public LocalDateTime getDatetime() {
return datetime;
}

public void setDatetime(LocalDateTime datetime) {
this.datetime = datetime;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.mapstruct.ap.test.bugs._3732;

import java.time.LocalDate;

public class ModelB {
private LocalDate datetime;

public LocalDate getDatetime() {
return datetime;
}

public void setDatetime(LocalDate datetime) {
this.datetime = datetime;
}
}