@Test public void executeWithResource() { SetDMNActiveModelCommand setDMNActiveModelCommand = new SetDMNActiveModelCommand(resource.getSourcePath()); assertThatThrownBy(() -> setDMNActiveModelCommand.execute(registryContext)) .isInstanceOf(IllegalStateException.class) .hasMessage("There is no DMNRuntime available"); registryContext.register(DMNRuntime.class, dmnRuntime); DMNModel dmnModel = setDMNActiveModelCommand.execute(registryContext); assertEquals(resource.getSourcePath(), dmnModel.getResource().getSourcePath()); }
@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);  }