### Question:
BridgeDeleteTaskExecutor extends BasicDeleteTaskExecutor { @Override public boolean isSupported(TaskExecutionContext context, TaskInfo task) { return super.isSupported(context, task) && getBridgeScript(context).isPresent(); } BridgeDeleteTaskExecutor();  BridgeDeleteTaskExecutor(Function<? super TaskExecutionContext, ? extends CommandLauncher> launchers); @Override boolean isSupported(TaskExecutionContext context, TaskInfo task); static final String DELEGATE_CLASS; }### Answer:
@Test public void simple() throws Exception { TaskInfo task = new BasicDeleteTaskInfo(PathKind.HADOOP_FILE_SYSTEM, "testing"); TaskExecutor executor = new BridgeDeleteTaskExecutor(ctxt -> (command, arguments) -> { assertThat(command.toRealPath(), is(HOME_DIR.resolve(PATH_BRIDGE_SCRIPT).toRealPath())); assertThat(Paths.get(arguments.get(0)), pathEndsWith(Constants.PATH_BRIDGE_LIBRARY)); assertThat(arguments.get(1), is(BridgeDeleteTaskExecutor.DELEGATE_CLASS)); assertThat(arguments.get(2), is("testing")); return 0; }); assertThat(executor.isSupported(context, task), is(true)); executor.execute(context, task); }
@Test public void resolved() throws Exception { TaskInfo task = new BasicDeleteTaskInfo(PathKind.HADOOP_FILE_SYSTEM, "${execution_id}"); TaskExecutor executor = new BridgeDeleteTaskExecutor(ctxt -> (command, arguments) -> { assertThat(command.toRealPath(), is(HOME_DIR.resolve(PATH_BRIDGE_SCRIPT).toRealPath())); assertThat(Paths.get(arguments.get(0)), pathEndsWith(Constants.PATH_BRIDGE_LIBRARY)); assertThat(arguments.get(1), is(BridgeDeleteTaskExecutor.DELEGATE_CLASS)); assertThat(arguments.get(2), is(context.getExecutionId())); return 0; }); assertThat(executor.isSupported(context, task), is(true)); executor.execute(context, task); }