@Test(expected = IllegalStateException.class) public void testGetOrCreateDMNTypeWhenTypeIsNotFound() { final String namespace = "namespace"; final Map<String, JSITItemDefinition> indexed = new HashMap<>(); final Map<String, ClientDMNType> createdTypes = new HashMap<>(); abstractKogitoDMNServiceSpy.getOrCreateDMNType(indexed, "unknownType", namespace, createdTypes); }
ClientDMNType getOrCreateDMNType(final Map<String, JSITItemDefinition> allDefinitions, final String requiredType, final String namespace, final Map<String, ClientDMNType> createdTypes) { if (createdTypes.containsKey(requiredType)) { return createdTypes.get(requiredType); } if (!allDefinitions.containsKey(requiredType)) { throw new IllegalStateException("Type '" + requiredType + "' not found."); } final JSITItemDefinition value = Js.uncheckedCast(allDefinitions.get(requiredType)); return createDMNType(allDefinitions, value, namespace, createdTypes); }
AbstractKogitoDMNService implements KogitoDMNService { ClientDMNType getOrCreateDMNType(final Map<String, JSITItemDefinition> allDefinitions, final String requiredType, final String namespace, final Map<String, ClientDMNType> createdTypes) { if (createdTypes.containsKey(requiredType)) { return createdTypes.get(requiredType); } if (!allDefinitions.containsKey(requiredType)) { throw new IllegalStateException("Type '" + requiredType + "' not found."); } final JSITItemDefinition value = Js.uncheckedCast(allDefinitions.get(requiredType)); return createDMNType(allDefinitions, value, namespace, createdTypes); } }
AbstractKogitoDMNService implements KogitoDMNService { ClientDMNType getOrCreateDMNType(final Map<String, JSITItemDefinition> allDefinitions, final String requiredType, final String namespace, final Map<String, ClientDMNType> createdTypes) { if (createdTypes.containsKey(requiredType)) { return createdTypes.get(requiredType); } if (!allDefinitions.containsKey(requiredType)) { throw new IllegalStateException("Type '" + requiredType + "' not found."); } final JSITItemDefinition value = Js.uncheckedCast(allDefinitions.get(requiredType)); return createDMNType(allDefinitions, value, namespace, createdTypes); }  }
AbstractKogitoDMNService implements KogitoDMNService { ClientDMNType getOrCreateDMNType(final Map<String, JSITItemDefinition> allDefinitions, final String requiredType, final String namespace, final Map<String, ClientDMNType> createdTypes) { if (createdTypes.containsKey(requiredType)) { return createdTypes.get(requiredType); } if (!allDefinitions.containsKey(requiredType)) { throw new IllegalStateException("Type '" + requiredType + "' not found."); } final JSITItemDefinition value = Js.uncheckedCast(allDefinitions.get(requiredType)); return createDMNType(allDefinitions, value, namespace, createdTypes); }  @Override FactModelTuple getFactModelTuple(final JSITDefinitions jsitDefinitions); boolean isJSITInputData(JSITDRGElement jsitdrgElement); boolean isJSITDecision(JSITDRGElement jsitdrgElement); Map<QName, String> getOtherAttributesMap(JSITDMNElement jsitInputDataVariable); }
AbstractKogitoDMNService implements KogitoDMNService { ClientDMNType getOrCreateDMNType(final Map<String, JSITItemDefinition> allDefinitions, final String requiredType, final String namespace, final Map<String, ClientDMNType> createdTypes) { if (createdTypes.containsKey(requiredType)) { return createdTypes.get(requiredType); } if (!allDefinitions.containsKey(requiredType)) { throw new IllegalStateException("Type '" + requiredType + "' not found."); } final JSITItemDefinition value = Js.uncheckedCast(allDefinitions.get(requiredType)); return createDMNType(allDefinitions, value, namespace, createdTypes); }  @Override FactModelTuple getFactModelTuple(final JSITDefinitions jsitDefinitions); boolean isJSITInputData(JSITDRGElement jsitdrgElement); boolean isJSITDecision(JSITDRGElement jsitdrgElement); Map<QName, String> getOtherAttributesMap(JSITDMNElement jsitInputDataVariable); static final String URI_FEEL; static final String WRONG_DMN_MESSAGE; }