@Test public void testGetConditionParameterDefinition() throws Exception { Map<ParameterName, ConditionParameterDefinition> map1 = new HashMap<ParameterName, ConditionParameterDefinition>(); ParameterName parameterName = mock(ParameterName.class); ConditionParameterDefinition conditionParameterDefinition = mock(ConditionParameterDefinition.class); map1.put(parameterName,conditionParameterDefinition); List<ConditionParameterDefinition> conditionParameterDefinitionList = new ArrayList<ConditionParameterDefinition>(); conditionParameterDefinitionList.add(conditionParameterDefinition); Class<GetDefinitions> class_1 = GetDefinitions.class; Field field = class_1.getDeclaredField("conditionParameterDefinitionList"); field.setAccessible(true); field.set(getDefinitions, conditionParameterDefinitionList); CheckedFuture conditionparadefinitionFuture = mock(CheckedFuture.class); ReadOnlyTransaction readOnlyTransaction = mock(ReadOnlyTransaction.class); when(dataBroker.newReadOnlyTransaction()).thenReturn(readOnlyTransaction); when(readOnlyTransaction.read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class))).thenReturn(conditionparadefinitionFuture); when(conditionParameterDefinition.getParameterName()).thenReturn(parameterName); Assert.assertEquals(getDefinitions.getConditionParameterDefinition(), map1); }
public Map<ParameterName, ConditionParameterDefinition> getConditionParameterDefinition(){ fetchConditionParaDefinitions(); Map<ParameterName, ConditionParameterDefinition> map = new HashMap<ParameterName, ConditionParameterDefinition>(); if (conditionParameterDefinitionList!=null){ for (ConditionParameterDefinition conditionParameterDefinition : conditionParameterDefinitionList){ map.put(conditionParameterDefinition.getParameterName(),conditionParameterDefinition); } } return map; }
GetDefinitions { public Map<ParameterName, ConditionParameterDefinition> getConditionParameterDefinition(){ fetchConditionParaDefinitions(); Map<ParameterName, ConditionParameterDefinition> map = new HashMap<ParameterName, ConditionParameterDefinition>(); if (conditionParameterDefinitionList!=null){ for (ConditionParameterDefinition conditionParameterDefinition : conditionParameterDefinitionList){ map.put(conditionParameterDefinition.getParameterName(),conditionParameterDefinition); } } return map; } }
GetDefinitions { public Map<ParameterName, ConditionParameterDefinition> getConditionParameterDefinition(){ fetchConditionParaDefinitions(); Map<ParameterName, ConditionParameterDefinition> map = new HashMap<ParameterName, ConditionParameterDefinition>(); if (conditionParameterDefinitionList!=null){ for (ConditionParameterDefinition conditionParameterDefinition : conditionParameterDefinitionList){ map.put(conditionParameterDefinition.getParameterName(),conditionParameterDefinition); } } return map; } GetDefinitions(DataBroker dataBroker); }
GetDefinitions { public Map<ParameterName, ConditionParameterDefinition> getConditionParameterDefinition(){ fetchConditionParaDefinitions(); Map<ParameterName, ConditionParameterDefinition> map = new HashMap<ParameterName, ConditionParameterDefinition>(); if (conditionParameterDefinitionList!=null){ for (ConditionParameterDefinition conditionParameterDefinition : conditionParameterDefinitionList){ map.put(conditionParameterDefinition.getParameterName(),conditionParameterDefinition); } } return map; } GetDefinitions(DataBroker dataBroker); Map<NodeType, NodeDefinition> getNodeDefinition(); Map<MatchItemName, MatchItemDefinition> getMatchItemDefinition(); Map<ConnectionType, ConnectionDefinition> getConnectionDefinition(); Map<ActionName, ActionDefinition> getActionDefinition(); Map<ParameterName, ConditionParameterDefinition> getConditionParameterDefinition(); Map<PhysicalHostName, PhysicalHost> getPhysicalHost(); }
GetDefinitions { public Map<ParameterName, ConditionParameterDefinition> getConditionParameterDefinition(){ fetchConditionParaDefinitions(); Map<ParameterName, ConditionParameterDefinition> map = new HashMap<ParameterName, ConditionParameterDefinition>(); if (conditionParameterDefinitionList!=null){ for (ConditionParameterDefinition conditionParameterDefinition : conditionParameterDefinitionList){ map.put(conditionParameterDefinition.getParameterName(),conditionParameterDefinition); } } return map; } GetDefinitions(DataBroker dataBroker); Map<NodeType, NodeDefinition> getNodeDefinition(); Map<MatchItemName, MatchItemDefinition> getMatchItemDefinition(); Map<ConnectionType, ConnectionDefinition> getConnectionDefinition(); Map<ActionName, ActionDefinition> getActionDefinition(); Map<ParameterName, ConditionParameterDefinition> getConditionParameterDefinition(); Map<PhysicalHostName, PhysicalHost> getPhysicalHost();  }