package com.remondis.remap.regression.implicitPrimitiveToWrapperMappingBug;

import org.junit.Test;

import com.remondis.remap.AssertMapping;
import com.remondis.remap.Mapper;
import com.remondis.remap.Mapping;

public class MappingTest {

  @Test
  public void integer_implicitMappingFromPrimitiveToWrapper() {
    Mapper<IntPrimitive, IntWrapper> mapper = Mapping.from(IntPrimitive.class)
        .to(IntWrapper.class)
        .mapper();
    AssertMapping.of(mapper)
        .ensure();
  }

  @Test
  public void integer_MappingWrapperToPrimitive() {
    Mapper<IntWrapper, IntPrimitive> mapper = Mapping.from(IntWrapper.class)
        .to(IntPrimitive.class)
        .mapper();
    AssertMapping.of(mapper)
        .ensure();
  }

  @Test
  public void boolean_implicitMappingFromPrimitiveToWrapper() {
    Mapper<BoolPrimitive, BoolWrapper> mapper = Mapping.from(BoolPrimitive.class)
        .to(BoolWrapper.class)
        .mapper();
    AssertMapping.of(mapper)
        .ensure();
  }

  @Test
  public void boolean_implicitMappingWrapperToPrimitive() {
    Mapper<BoolWrapper, BoolPrimitive> mapper = Mapping.from(BoolWrapper.class)
        .to(BoolPrimitive.class)
        .mapper();
    AssertMapping.of(mapper)
        .ensure();
  }
}

@@ -70,16 +70,60 @@
 ngBug;%0A%0A
+import static org.junit.Assert.assertTrue;%0A%0A
 import o
@@ -137,16 +137,16 @@
 t.Test;%0A
-
 %0Aimport 
@@ -469,32 +469,193 @@
      .mapper();%0A
+%0A    IntPrimitive intPrim = new IntPrimitive(101);%0A    IntWrapper intWrap = mapper.map(intPrim);%0A%0A    assertTrue(intPrim.getInteger() == intWrap.getInteger());%0A%0A
     AssertMappin
@@ -871,32 +871,208 @@
      .mapper();%0A
+%0A    IntWrapper intWrap = new IntWrapper(Integer.valueOf(101));%0A    IntPrimitive intPrim = mapper.map(intWrap);%0A%0A    assertTrue(intWrap.getInteger() == intPrim.getInteger());%0A%0A
     AssertMappin
@@ -1304,32 +1304,175 @@
      .mapper();%0A
+%0A    BoolPrimitive prim = new BoolPrimitive(true);%0A    BoolWrapper wrap = mapper.map(prim);%0A%0A    assertTrue(prim.isBool() == wrap.getBool());%0A%0A
     AssertMappin
@@ -1681,32 +1681,32 @@
 rimitive.class)%0A
-
         .mapper(
@@ -1708,16 +1708,157 @@
 pper();%0A
+%0A    BoolWrapper wrap = new BoolWrapper(true);%0A    BoolPrimitive prim = mapper.map(wrap);%0A%0A    assertTrue(wrap.getBool() == prim.isBool());%0A%0A
     Asse

Support auto(un)boxing for reassign operation