Package com.philip.journal.core.dao

Examples of com.philip.journal.core.dao.UserDAO


        final ServiceFacade mockedFacade = Mockito.mock(ServiceFacade.class);
        getSession().put(BusinessServiceProxy.SERVICE_FACADE, mockedFacade);

        final BranchDAO mockBranchDAO = mock(BranchDAO.class);
        final EntryDAO mockEntryDAO = mock(EntryDAO.class);
        final UserDAO mockUserDAO = mock(UserDAO.class);
        final ConfigItemDAO mockConfigDAO = mock(ConfigItemDAO.class);

        when(daoFacade.getConfigItemDAO()).thenReturn(mockConfigDAO);
        when(mockConfigDAO.readAll()).thenReturn(new ArrayList<ConfigItem>());

        when(daoFacade.getBranchDAO()).thenReturn(mockBranchDAO);
        testRootBranch = new Branch(Constant.ROOT_NAME, null); //mock(Branch.class);
        testRootBranch.setBranchId(Constant.ROOT_ID);
        when(mockBranchDAO.read(Constant.ROOT_ID)).thenReturn(testRootBranch);
        /*
         * when(TEST_ROOT_BRANCH.getBranchId()).thenReturn(Constant.ROOT_ID);
         * when(TEST_ROOT_BRANCH.getName()).thenReturn(Constant.ROOT_NAME);
         */
        when(daoFacade.getEntryDAO()).thenReturn(mockEntryDAO);

        when(daoFacade.getUserDAO()).thenReturn(mockUserDAO);
        when(mockUserDAO.readByUsername(eq(JournalTestCommon.TEST_USERNAME))).thenReturn(testUser);

        try {
            testInstance = getTestInstanceClass().newInstance();
        } catch (final Exception e) {
            logger.error(e.getMessage(), e);
View Full Code Here

TOP

Related Classes of com.philip.journal.core.dao.UserDAO

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.