Package ma.glasnost.orika.test.enums.EnumsTestCaseClasses

Examples of ma.glasnost.orika.test.enums.EnumsTestCaseClasses.Book


import org.junit.Test;

public class EnumsTestCase {
   
    private Book createBook() {
        Book book = new BookImpl();
        book.setTitle("The Prophet");
        book.setFormat(PublicationFormat.EBOOK);
        return book;
    }
View Full Code Here


    @Test
    public void testMapSharedEnum() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        MapperFacade mapper = factory.getMapperFacade();
       
        Book book = createBook();
        BookDTOWithSameEnum mappedBook = mapper.map(book, BookDTOWithSameEnum.class);
       
        Assert.assertEquals(book.getTitle(), mappedBook.getTitle());
        Assert.assertEquals(book.getFormat(), mappedBook.getFormat());
    }
View Full Code Here

    @Test
    public void testMapParallelEnum() {
        MapperFactory factory = MappingUtil.getMapperFactory();
        MapperFacade mapper = factory.getMapperFacade();
       
        Book book = createBook();
        BookDTOWithParallelEnum mappedBook = mapper.map(book, BookDTOWithParallelEnum.class);
       
        Assert.assertEquals(book.getTitle(), mappedBook.getTitle());
        Assert.assertEquals(book.getFormat().name(), mappedBook.getFormat().name());
    }
View Full Code Here

            }
        });
       
        MapperFacade mapper = factory.getMapperFacade();
       
        Book book = createBook();
        BookDTOWithAltCaseEnum mappedBook = mapper.map(book, BookDTOWithAltCaseEnum.class);
       
        Assert.assertEquals(book.getTitle(), mappedBook.getTitle());
        Assert.assertEquals(book.getFormat().toString().toUpperCase(), mappedBook.getFormat().toString().toUpperCase());
    }
View Full Code Here

            }
        });
       
        MapperFacade mapper = factory.getMapperFacade();
       
        Book book = createBook();
        BookDTOWithAlternateEnum mappedBook = mapper.map(book, BookDTOWithAlternateEnum.class);
       
        Assert.assertEquals(book.getTitle(), mappedBook.getTitle());
        Assert.assertEquals("PUB_" + book.getFormat().toString(), mappedBook.getFormat().toString());
    }
View Full Code Here

TOP

Related Classes of ma.glasnost.orika.test.enums.EnumsTestCaseClasses.Book

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.