Skip to content
Snippets Groups Projects
Commit 1c1e7142 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

fix on unit test

parent 62ab0f20
No related branches found
No related tags found
1 merge request!82fix on unit test
......@@ -41,6 +41,7 @@ public class ConfigurationBeanTest extends WebTestFunctions {
user2 = new User();
userService.addUser(user2);
userService.setUserPrivilege(user2, PrivilegeType.CONFIGURATION_MANAGE);
userService.setUserPrivilege(user2, PrivilegeType.ADD_MAP);
uBean.setLoggedUser(user2);
oldValue = configurationService.getConfigurationValue(ConfigurationElementType.DEFAULT_MAP);
......@@ -54,35 +55,6 @@ public class ConfigurationBeanTest extends WebTestFunctions {
configurationService.setConfigurationValue(ConfigurationElementType.DEFAULT_MAP, oldValue);
}
@Test
public void test() throws Exception {
try {
cBean.refreshValues(null);
assertTrue(cBean.getValues().size() > 0);
List<ConfigurationView> list = new ArrayList<ConfigurationView>();
ConfigurationView element = configurationViewFactory.create(configurationDao.getByType(ConfigurationElementType.DEFAULT_MAP));
element.setValue("sdfsa");
list.add(element);
// rollback should appear
cBean.setValues(list);
assertTrue(cBean.getValues().size() != 1);
for (ProjectView row : projectService.getAllProjectViews()) {
if (row.getProjectId() == null)
continue;
element.setValue(row.getProjectId());
cBean.setValues(list);
assertEquals(cBean.getValues(), list);
cBean.setValues(new ArrayList<ConfigurationView>());
}
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
/**
* Checks if bean implements {@link Serializable} properly.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment