fix: Make mapper static

This commit is contained in:
Krrish Ghimire
2019-12-03 23:29:08 +05:45
parent 8fc1410cd0
commit 7a7d25635e
2 changed files with 3 additions and 9 deletions

View File

@@ -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());
}
}