Home / Function/ setup() — spring-boot Function Reference

setup() — spring-boot Function Reference

Architecture documentation for the setup() function in CommandRunnerTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  fad2af55_73b0_6155_f655_b21636f7ab37["setup()"]
  c84c5a87_8c46_951d_34ab_999d2387ef38["HelpCommand()"]
  fad2af55_73b0_6155_f655_b21636f7ab37 -->|calls| c84c5a87_8c46_951d_34ab_999d2387ef38
  ed677779_3218_5910_6ec6_1fb4aceafa07["HintCommand()"]
  fad2af55_73b0_6155_f655_b21636f7ab37 -->|calls| ed677779_3218_5910_6ec6_1fb4aceafa07
  style fad2af55_73b0_6155_f655_b21636f7ab37 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java lines 68–97

	@BeforeEach
	void setup() {
		this.loader = Thread.currentThread().getContextClassLoader();
		this.commandRunner = new CommandRunner("spring") {

			@Override
			protected void showUsage() {
				CommandRunnerTests.this.calls.add(Call.SHOW_USAGE);
				super.showUsage();
			}

			@Override
			protected boolean errorMessage(@Nullable String message) {
				CommandRunnerTests.this.calls.add(Call.ERROR_MESSAGE);
				return super.errorMessage(message);
			}

			@Override
			protected void printStackTrace(Exception ex) {
				CommandRunnerTests.this.calls.add(Call.PRINT_STACK_TRACE);
				super.printStackTrace(ex);
			}
		};
		lenient().doReturn("another").when(this.anotherCommand).getName();
		lenient().doReturn("command").when(this.regularCommand).getName();
		lenient().doReturn("A regular command").when(this.regularCommand).getDescription();
		this.commandRunner.addCommand(this.regularCommand);
		this.commandRunner.addCommand(new HelpCommand(this.commandRunner));
		this.commandRunner.addCommand(new HintCommand(this.commandRunner));
	}

Domain

Subdomains

Frequently Asked Questions

What does setup() do?
setup() is a function in the spring-boot codebase.
What does setup() call?
setup() calls 2 function(s): HelpCommand, HintCommand.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free