package org.modelmapper.bugs;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

import org.modelmapper.AbstractTest;
import org.modelmapper.Converter;
import org.modelmapper.config.Configuration.AccessLevel;
import org.modelmapper.spi.MappingContext;
import org.testng.annotations.Test;

/**
 * https://github.com/jhalterman/modelmapper/issues/?
 * 
 * Reported by Kay Schubert.
 */
@Test
public class ShadedTestMissesTrailingDot extends AbstractTest {
	public static class SubItem {
		private String value;

		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}
	}

	public static class Source {
		private String item;
		private SubItem itemX;
		
		public String getItem() {
			return item;
		}
		
		public void setItem(String item) {
			this.item = item;
		}
		
		public SubItem getItemX() {
			return itemX;
		}
		
		public void setItemX(SubItem itemX) {
			this.itemX = itemX;
		}
	}

	public static class Destination {
		private String item;
		private SubItem itemX;
		
		public String getItem() {
			return item;
		}
		
		public void setItem(String item) {
			this.item = item;
		}
		
		public SubItem getItemX() {
			return itemX;
		}
		
		public void setItemX(SubItem itemX) {
			this.itemX = itemX;
		}
	}

	public void test() {
		String expectedNameXValue = "someValue";
		Source source = new Source();
		SubItem subItemX = new SubItem();
		subItemX.setValue(expectedNameXValue);
		source.setItemX(subItemX);

		Destination result = modelMapper.map(source, Destination.class);

		assertEquals(expectedNameXValue, result.getItemX().getValue());
	}
}

@@ -491,184 +491,8 @@
 st %7B
-%0A%09public static class SubItem %7B%0A%09%09private String value;%0A%0A%09%09public String getValue() %7B%0A%09%09%09return value;%0A%09%09%7D%0A%0A%09%09public void setValue(String value) %7B%0A%09%09%09this.value = value;%0A%09%09%7D%0A%09%7D
 %0A%0A%09p
@@ -545,38 +545,37 @@
 tem;%0A%09%09private S
-ubItem
+tring
  itemX;%0A%09%09%0A%09%09pub
@@ -687,38 +687,37 @@
 %09%7D%0A%09%09%0A%09%09public S
-ubItem
+tring
  getItemX() %7B%0A%09%09
@@ -754,38 +754,37 @@
  void setItemX(S
-ubItem
+tring
  itemX) %7B%0A%09%09%09thi
@@ -877,22 +877,21 @@
 rivate S
-ubItem
+tring
  itemX;%0A
@@ -1019,22 +1019,21 @@
 public S
-ubItem
+tring
  getItem
@@ -1086,22 +1086,21 @@
 tItemX(S
-ubItem
+tring
  itemX) 
@@ -1235,109 +1235,42 @@
 ;%0A%09%09
-SubItem subItemX = new SubItem();%0A%09%09subItemX.setValue(expectedNameXValue);%0A%09%09source.setItemX(subItemX
+source.setItemX(expectedNameXValue
 );%0A%0A
@@ -1393,19 +1393,8 @@
 mX()
-.getValue()
 );%0A%09

test simplified: no need to make the second property a bean itself - it is sufficient to be a simple value