use of org.ovirt.engine.api.restapi.test.mappers.api.IBar in project ovirt-engine by oVirt.
the class MappingLocatorTest method testStaticBarToFooInterfaceMapper.
@Test
public void testStaticBarToFooInterfaceMapper() {
Mapper<IBar, IFoo> mapper = mappingLocator.getMapper(IBar.class, IFoo.class);
assertNotNull(mapper);
IFoo foo = mapper.map(new BarImpl("bar"), null);
assertEquals("bar", foo.get());
}
use of org.ovirt.engine.api.restapi.test.mappers.api.IBar in project ovirt-engine by oVirt.
the class StaticMapper method mapFooToBarInterfaces.
@Mapping(from = IFoo.class, to = IBar.class)
public static IBar mapFooToBarInterfaces(IFoo foo, IBar template) {
IBar bar = template != null ? template : new BarImpl();
bar.set(foo.get());
return bar;
}
use of org.ovirt.engine.api.restapi.test.mappers.api.IBar in project ovirt-engine by oVirt.
the class MappingLocatorTest method testStaticFooToBarInterfaceMapper.
@Test
public void testStaticFooToBarInterfaceMapper() {
Mapper<IFoo, IBar> mapper = mappingLocator.getMapper(IFoo.class, IBar.class);
assertNotNull(mapper);
IBar bar = mapper.map(new FooImpl("foo"), null);
assertEquals("foo", bar.get());
}
use of org.ovirt.engine.api.restapi.test.mappers.api.IBar in project ovirt-engine by oVirt.
the class MappingLocatorTest method testStaticFooToBarClassMapper.
@Test
public void testStaticFooToBarClassMapper() {
Mapper<FooImpl, BarImpl> mapper = mappingLocator.getMapper(FooImpl.class, BarImpl.class);
assertNotNull(mapper);
IBar bar = mapper.map(new FooImpl("foo"), null);
assertEquals("foo", bar.get());
}
Aggregations