-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94143e5
commit 233f3dd
Showing
2 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/test/java/io/vlingo/xoom/cli/CommandLineInterfaceInitializerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright © 2012-2021 VLINGO LABS. All rights reserved. | ||
// | ||
// This Source Code Form is subject to the terms of the | ||
// Mozilla Public License, v. 2.0. If a copy of the MPL | ||
// was not distributed with this file, You can obtain | ||
// one at https://mozilla.org/MPL/2.0/. | ||
package io.vlingo.xoom.cli; | ||
|
||
import io.vlingo.xoom.actors.Logger; | ||
import io.vlingo.xoom.terminal.CommandRetainer; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class CommandLineInterfaceInitializerTest { | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
ComponentsRegistration.registerWith(Logger.noOpLogger(), new CommandRetainer(), XoomTurboProperties.empty()); | ||
} | ||
|
||
@Test | ||
public void testThatCommandIsResolved() { | ||
Assertions.assertEquals("designer", CommandLineInterfaceInitializer.resolveCommand(new String[]{})); | ||
Assertions.assertEquals("designer", CommandLineInterfaceInitializer.resolveCommand(new String[]{"designer"})); | ||
Assertions.assertEquals("designer", CommandLineInterfaceInitializer.resolveCommand(new String[]{"designer", "--target", "filesystem", "--profile", "test"})); | ||
Assertions.assertEquals("docker package", CommandLineInterfaceInitializer.resolveCommand(new String[]{"docker", "package"})); | ||
Assertions.assertEquals("docker package", CommandLineInterfaceInitializer.resolveCommand(new String[]{"docker", "package", "--tag", "latest"})); | ||
} | ||
|
||
} |