use of org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl in project ovirt-engine by oVirt.
the class MappingLocatorTest method testStaticTemplatedFooToBarClassMapper.
@Test
public void testStaticTemplatedFooToBarClassMapper() {
Mapper<FooImpl, BarImpl> mapper = mappingLocator.getMapper(FooImpl.class, BarImpl.class);
assertNotNull(mapper);
BarImpl bar = mapper.map(new FooImpl("foo"), new BarImpl("overwrite", "keep"));
assertEquals("foo", bar.get());
assertEquals("keep", bar.other());
}
use of org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl in project ovirt-engine by oVirt.
the class MappingLocatorTest method testStaticBarToFooClassMapper.
@Test
public void testStaticBarToFooClassMapper() {
Mapper<BarImpl, FooImpl> mapper = mappingLocator.getMapper(BarImpl.class, FooImpl.class);
assertNotNull(mapper);
IFoo foo = mapper.map(new BarImpl("bar"), null);
assertEquals("bar", foo.get());
}
use of org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl in project ovirt-engine by oVirt.
the class StaticMapper method mapBarToFooInterfaces.
@Mapping(from = IBar.class, to = IFoo.class)
public static IFoo mapBarToFooInterfaces(IBar bar, IFoo template) {
IFoo foo = template != null ? template : new FooImpl();
foo.set(bar.get());
return foo;
}
use of org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl in project ovirt-engine by oVirt.
the class StaticMapper method mapBarToFooClasses.
@Mapping(from = BarImpl.class, to = FooImpl.class)
public static FooImpl mapBarToFooClasses(IBar bar, FooImpl template) {
FooImpl foo = template != null ? template : new FooImpl();
foo.set(bar.get());
return foo;
}
use of org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl 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());
}
Aggregations