|
|
@ -5,17 +5,11 @@ import org.junit.jupiter.api.*; |
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
|
|
|
|
class MapperTest { |
|
|
|
class MapperTest { |
|
|
|
private Mapper mapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
|
|
|
|
void setUp() { |
|
|
|
|
|
|
|
mapper = new Mapper(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void testEmptyFieldsMap() { |
|
|
|
void testEmptyFieldsMap() { |
|
|
|
Source source = new Source(); |
|
|
|
Source source = new Source(); |
|
|
|
Object destination = mapper.map(source, "np.com.krrish.Destination"); |
|
|
|
Object destination = Mapper.map(source, "np.com.krrish.Destination"); |
|
|
|
assertEquals(Destination.class, destination.getClass()); |
|
|
|
assertEquals(Destination.class, destination.getClass()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -25,7 +19,7 @@ class MapperTest { |
|
|
|
source.setFirst("first"); |
|
|
|
source.setFirst("first"); |
|
|
|
source.setSecond("second"); |
|
|
|
source.setSecond("second"); |
|
|
|
|
|
|
|
|
|
|
|
Destination destination = (Destination) mapper.map(source, "np.com.krrish.Destination"); |
|
|
|
Destination destination = (Destination) Mapper.map(source, "np.com.krrish.Destination"); |
|
|
|
assertEquals("first", destination.getFirst()); |
|
|
|
assertEquals("first", destination.getFirst()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|