@Test public void testWithAuthentication() throws Exception { final ArgumentCaptor<Object> argumentCaptorAll = ArgumentCaptor.forClass(Object.class); final ScriptExecutionCommand command = mock(ScriptExecutionCommand.class); whenNew(ScriptExecutionCommand.class) .withArguments(argumentCaptorAll.capture(), argumentCaptorListArgument.capture(), eq(true)) .thenReturn(command); final Argument arg1 = mock(Argument.class); final Argument arg2 = mock(Argument.class); adder.withArguments(arg1, arg2).withAuthentication(true).commit(); verify(commandQueue).addInCclSessionCommand(command); final String scriptName = (String) argumentCaptorAll.getAllValues().get(0); assertThat(scriptName).isEqualTo(THE_SCRIPT_NAME); final List<Argument> args = argumentCaptorListArgument.getAllValues().get(0); assertThat(args).containsOnly(arg1, arg2); }
@Override public ScriptExecutionAdder withAuthentication(final boolean authenticate) { this.authenticate = authenticate; return this; }
ScriptExecutionAdderImpl implements ScriptExecutionAdder { @Override public ScriptExecutionAdder withAuthentication(final boolean authenticate) { this.authenticate = authenticate; return this; } }
ScriptExecutionAdderImpl implements ScriptExecutionAdder { @Override public ScriptExecutionAdder withAuthentication(final boolean authenticate) { this.authenticate = authenticate; return this; } ScriptExecutionAdderImpl(final String scriptName, final CommandQueue queue); }
ScriptExecutionAdderImpl implements ScriptExecutionAdder { @Override public ScriptExecutionAdder withAuthentication(final boolean authenticate) { this.authenticate = authenticate; return this; } ScriptExecutionAdderImpl(final String scriptName, final CommandQueue queue); @Override void commit(); @Override ScriptExecutionAdder withReplace(final String recordName, final Record record); @Override ScriptExecutionAdder withArguments(final Argument... arguments); @Override ScriptExecutionAdder withAuthentication(final boolean authenticate); }
ScriptExecutionAdderImpl implements ScriptExecutionAdder { @Override public ScriptExecutionAdder withAuthentication(final boolean authenticate) { this.authenticate = authenticate; return this; } ScriptExecutionAdderImpl(final String scriptName, final CommandQueue queue); @Override void commit(); @Override ScriptExecutionAdder withReplace(final String recordName, final Record record); @Override ScriptExecutionAdder withArguments(final Argument... arguments); @Override ScriptExecutionAdder withAuthentication(final boolean authenticate);  }