-
- when(commonClassDao.getDataByQuery("FROM PolicyEntity where policyName = 'Config_SampleTest1206.1.xml' and scope ='com'", new SimpleBindings())).thenReturn(data);
- }
-
- @Test
- public void dummy(){
- System.out.println("Dummy");
- }
+
+ when(commonClassDao.getDataByQuery(
+ "FROM PolicyEntity where policyName = 'Config_SampleTest1206.1.xml' and scope ='com'",
+ new SimpleBindings())).thenReturn(data);
+
+ FunctionDefinition fnDefinition = new FunctionDefinition();
+ fnDefinition.setXacmlid("Test");
+ fnDefinition.setShortname("Test");
+ Datatype dataType = new Datatype();
+ dataType.setXacmlId("Test");
+ fnDefinition.setDatatypeBean(dataType);
+ List<Object> fnObjects = new ArrayList<>();
+ fnObjects.add(fnDefinition);
+ when(commonClassDao.getData(FunctionDefinition.class)).thenReturn(fnObjects);
+ }
+
+ @Test
+ public void testInit() {
+ PolicyController controller = new PolicyController();
+ PolicyController.setjUnit(true);
+ controller.init();
+ try {
+ assertTrue(PolicyController.dropDownMap.size() > 0);
+ } catch (Exception e) {
+ logger.error("Exception Occured" + e);
+ fail();
+ }
+ }