@Test public void execute() { String namespace = "http: String modelName = "typecheck in DT"; SetDMNActiveModelCommand setDMNActiveModelCommand = new SetDMNActiveModelCommand(namespace, modelName); assertThatThrownBy(() -> setDMNActiveModelCommand.execute(registryContext)) .isInstanceOf(IllegalStateException.class) .hasMessage("There is no DMNRuntime available"); registryContext.register(DMNRuntime.class, dmnRuntime); DMNModel dmnModel = setDMNActiveModelCommand.execute(registryContext); assertEquals(namespace, dmnModel.getNamespace()); assertEquals(modelName, dmnModel.getName()); }
@Override public DMNModel execute(Context context) { RegistryContext registryContext = (RegistryContext) context; DMNModel activeModel = getDMNModel(context);; registryContext.register(DMNModel.class, activeModel); return activeModel; }
SetDMNActiveModelCommand extends AbstractDMNModelCommand { @Override public DMNModel execute(Context context) { RegistryContext registryContext = (RegistryContext) context; DMNModel activeModel = getDMNModel(context);; registryContext.register(DMNModel.class, activeModel); return activeModel; } }
SetDMNActiveModelCommand extends AbstractDMNModelCommand { @Override public DMNModel execute(Context context) { RegistryContext registryContext = (RegistryContext) context; DMNModel activeModel = getDMNModel(context);; registryContext.register(DMNModel.class, activeModel); return activeModel; } SetDMNActiveModelCommand(String namespace, String modelName);  SetDMNActiveModelCommand(String resourcePath); }
SetDMNActiveModelCommand extends AbstractDMNModelCommand { @Override public DMNModel execute(Context context) { RegistryContext registryContext = (RegistryContext) context; DMNModel activeModel = getDMNModel(context);; registryContext.register(DMNModel.class, activeModel); return activeModel; } SetDMNActiveModelCommand(String namespace, String modelName);  SetDMNActiveModelCommand(String resourcePath); @Override DMNModel execute(Context context); }
SetDMNActiveModelCommand extends AbstractDMNModelCommand { @Override public DMNModel execute(Context context) { RegistryContext registryContext = (RegistryContext) context; DMNModel activeModel = getDMNModel(context);; registryContext.register(DMNModel.class, activeModel); return activeModel; } SetDMNActiveModelCommand(String namespace, String modelName);  SetDMNActiveModelCommand(String resourcePath); @Override DMNModel execute(Context context);  }