diff --git a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java index ea47bac6c..b706d944a 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/commandlet/StatusCommandlet.java @@ -80,4 +80,10 @@ private void logOnlineStatus() { this.context.warning("You are offline. Check your internet connection and potential proxy settings."); } } + + @Override + public boolean isIdeRootRequired() { + + return false; + } } diff --git a/cli/src/test/java/com/devonfw/tools/ide/commandlet/StatusCommandletTest.java b/cli/src/test/java/com/devonfw/tools/ide/commandlet/StatusCommandletTest.java new file mode 100644 index 000000000..f9ba353a1 --- /dev/null +++ b/cli/src/test/java/com/devonfw/tools/ide/commandlet/StatusCommandletTest.java @@ -0,0 +1,29 @@ +package com.devonfw.tools.ide.commandlet; + +import org.junit.jupiter.api.Test; + +import com.devonfw.tools.ide.cli.CliArguments; +import com.devonfw.tools.ide.context.AbstractIdeContextTest; +import com.devonfw.tools.ide.context.IdeTestContext; + +/** + * Test of {@link StatusCommandlet}. + */ +public class StatusCommandletTest extends AbstractIdeContextTest { + + private static final String PROJECT_BASIC = "basic"; + + @Test + public void testStatusOutsideOfHome() { + //arrange + IdeTestContext context = new IdeTestContext(); + CliArguments args = new CliArguments("status"); + args.next(); + + //act + context.run(args); + + //assert + assertThat(context).logAtWarning().hasMessageContaining("You are not inside an IDE installation: "); + } +}