@Test
public void test1MapViewToEntityBean() {

	XXServiceDefDao xServiceDefDao = Mockito.mock(XXServiceDefDao.class);
	XXServiceDef xServiceDef = Mockito.mock(XXServiceDef.class);
	RangerService rangerService = rangerService();
	XXService service = service();
	int OPERATION_CONTEXT = 1;
	Mockito.when(daoManager.getXXServiceDef()).thenReturn(xServiceDefDao);
	Mockito.when(xServiceDefDao.findByName(rangerService.getType()))
			.thenReturn(xServiceDef);
	XXService dbService = rangerServiceService.mapViewToEntityBean(
			rangerService, service, OPERATION_CONTEXT);
	Assert.assertNotNull(dbService);
	Assert.assertEquals(dbService, service);
	Assert.assertEquals(dbService.getDescription(),
			service.getDescription());
	Assert.assertEquals(dbService.getGuid(), service.getGuid());
	Assert.assertEquals(dbService.getName(), service.getName());
	Assert.assertEquals(dbService.getAddedByUserId(),
			service.getAddedByUserId());
	Assert.assertEquals(dbService.getId(), service.getId());
	Assert.assertEquals(dbService.getVersion(), service.getVersion());
	Assert.assertEquals(dbService.getType(), service.getType());
	Assert.assertEquals(dbService.getUpdatedByUserId(),
			service.getUpdatedByUserId());
	Mockito.verify(daoManager).getXXServiceDef();
}