|
|
|
@ -5,17 +5,11 @@ import org.junit.jupiter.api.*;
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*; |
|
|
|
|
|
|
|
|
|
class MapperTest { |
|
|
|
|
private Mapper mapper; |
|
|
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
|
void setUp() { |
|
|
|
|
mapper = new Mapper(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void testEmptyFieldsMap() { |
|
|
|
|
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()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -25,7 +19,7 @@ class MapperTest {
|
|
|
|
|
source.setFirst("first"); |
|
|
|
|
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()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|