⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lookupmanagerimpltest.java

📁 基于Maven的质量保证自动化环境配置和演示程序
💻 JAVA
字号:
package com.cib.service.impl;import com.cib.dao.LookupDao;import com.cib.model.Role;import com.cib.model.LabelValue;import com.cib.Constants;import org.jmock.Expectations;import org.junit.Before;import org.junit.Test;import static org.junit.Assert.*;import java.util.ArrayList;import java.util.List;public class LookupManagerImplTest extends BaseManagerMockTestCase {    private LookupManagerImpl mgr = new LookupManagerImpl();    private LookupDao lookupDao = null;    @Before    public void setUp() throws Exception {        lookupDao = context.mock(LookupDao.class);        mgr.setLookupDao(lookupDao);    }    @Test    public void testGetAllRoles() {        log.debug("entered 'testGetAllRoles' method");        // set expected behavior on dao        Role role = new Role(Constants.ADMIN_ROLE);        final List<Role> testData = new ArrayList<Role>();        testData.add(role);        context.checking(new Expectations() {{            one(lookupDao).getRoles();            will(returnValue(testData));        }});        List<LabelValue> roles = mgr.getAllRoles();        assertTrue(roles.size() > 0);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -