Example usage for org.springframework.boot.cli.command.status ExitStatus ERROR

List of usage examples for org.springframework.boot.cli.command.status ExitStatus ERROR

Introduction

In this page you can find the example usage for org.springframework.boot.cli.command.status ExitStatus ERROR.

Prototype

ExitStatus ERROR

To view the source code for org.springframework.boot.cli.command.status ExitStatus ERROR.

Click Source Link

Document

Generic "not OK" exit status with non-zero exit code and hangup=true .

Usage

From source file:org.springframework.boot.cli.command.init.InitCommandTests.java

@Test
public void generateProjectNoFileNameAvailable() throws Exception {
    MockHttpProjectGenerationRequest request = new MockHttpProjectGenerationRequest("application/zip", null);
    mockSuccessfulProjectGeneration(request);
    assertThat(this.command.run()).isEqualTo(ExitStatus.ERROR);
}

From source file:org.springframework.boot.cli.command.init.InitCommandTests.java

@Test
public void fileNotOverwrittenByDefault() throws Exception {
    File file = this.temporaryFolder.newFile();
    long fileLength = file.length();
    MockHttpProjectGenerationRequest request = new MockHttpProjectGenerationRequest("application/zip",
            file.getAbsolutePath());/*from w w  w .  j ava 2s  .co m*/
    mockSuccessfulProjectGeneration(request);
    assertThat(this.command.run()).as("Should have failed").isEqualTo(ExitStatus.ERROR);
    assertThat(file.length()).as("File should not have changed").isEqualTo(fileLength);
}

From source file:org.springframework.boot.cli.command.init.InitCommandTests.java

@Test
public void fileInArchiveNotOverwrittenByDefault() throws Exception {
    File folder = this.temporaryFolder.newFolder();
    File conflict = new File(folder, "test.txt");
    assertThat(conflict.createNewFile()).as("Should have been able to create file").isTrue();
    long fileLength = conflict.length();
    // also contains test.txt
    byte[] archive = createFakeZipArchive("test.txt", "Fake content");
    MockHttpProjectGenerationRequest request = new MockHttpProjectGenerationRequest("application/zip",
            "demo.zip", archive);
    mockSuccessfulProjectGeneration(request);
    assertThat(this.command.run("--extract", folder.getAbsolutePath())).isEqualTo(ExitStatus.ERROR);
    assertThat(conflict.length()).as("File should not have changed").isEqualTo(fileLength);
}

From source file:org.springframework.boot.cli.command.init.InitCommandTests.java

@Test
public void parseMoreThanOneArg() throws Exception {
    this.handler.disableProjectGeneration();
    assertThat(this.command.run("foobar", "barfoo")).isEqualTo(ExitStatus.ERROR);
}