-
Notifications
You must be signed in to change notification settings - Fork 17
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
2aeb1be
commit c93b357
Showing
13 changed files
with
243 additions
and
17 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
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
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
24 changes: 24 additions & 0 deletions
24
modules/apps/src/test/java/com/axway/apim/appexport/lib/AppExportCLIOptionsTest.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,24 @@ | ||
package com.axway.apim.appexport.lib; | ||
|
||
import com.axway.apim.lib.CLIOptions; | ||
import com.axway.apim.lib.error.AppException; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.PrintStream; | ||
|
||
public class AppExportCLIOptionsTest { | ||
|
||
@Test | ||
public void printUsage() throws AppException { | ||
PrintStream old = System.out; | ||
String[] args = {"-h", "localhost", "-n", "test"}; | ||
CLIOptions options = AppExportCLIOptions.create(args); | ||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | ||
System.setOut(new PrintStream(byteArrayOutputStream)); | ||
options.printUsage("test", args); | ||
System.setOut(old); | ||
Assert.assertTrue(byteArrayOutputStream.toString().contains("-n test")); | ||
} | ||
} |
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
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
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
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
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
25 changes: 25 additions & 0 deletions
25
modules/users/src/test/java/com/axway/apim/user/cli/UserChangePasswordCLIOptionsTest.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,25 @@ | ||
package com.axway.apim.user.cli; | ||
|
||
import com.axway.apim.lib.CLIOptions; | ||
import com.axway.apim.lib.error.AppException; | ||
import com.axway.apim.users.lib.cli.UserChangePasswordCLIOptions; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.PrintStream; | ||
|
||
public class UserChangePasswordCLIOptionsTest { | ||
|
||
@Test | ||
public void printUsage() throws AppException { | ||
PrintStream old = System.out; | ||
String[] args = {"-s", "prod", "-id", "UUID-ID-OF-THE-USER", "-loginName", "*mark24*", "-n", "*Mark*", "-email", "*@axway.com*", "-type", "external", "-org", "*Partner*", "-role", "oadmin", "-state", "pending", "-enabled", "true", "-o", "json", "-newpassword", "123456"}; | ||
CLIOptions options = UserChangePasswordCLIOptions.create(args); | ||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | ||
System.setOut(new PrintStream(byteArrayOutputStream)); | ||
options.printUsage("test", args); | ||
System.setOut(old); | ||
Assert.assertTrue(byteArrayOutputStream.toString().contains("-id UUID-ID-OF-THE-USER")); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
modules/users/src/test/java/com/axway/apim/user/cli/UserDeleteCLIOptionsTest.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,25 @@ | ||
package com.axway.apim.user.cli; | ||
|
||
import com.axway.apim.lib.CLIOptions; | ||
import com.axway.apim.lib.error.AppException; | ||
import com.axway.apim.users.lib.cli.UserDeleteCLIOptions; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.PrintStream; | ||
|
||
public class UserDeleteCLIOptionsTest { | ||
|
||
@Test | ||
public void printUsage() throws AppException { | ||
PrintStream old = System.out; | ||
String[] args = {"-s", "prod", "-n", "test"}; | ||
CLIOptions options = UserDeleteCLIOptions.create(args); | ||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | ||
System.setOut(new PrintStream(byteArrayOutputStream)); | ||
options.printUsage("test", args); | ||
System.setOut(old); | ||
Assert.assertTrue(byteArrayOutputStream.toString().contains("-n test")); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
modules/users/src/test/java/com/axway/apim/user/cli/UserExportCLIOptionsTest.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,25 @@ | ||
package com.axway.apim.user.cli; | ||
|
||
import com.axway.apim.lib.CLIOptions; | ||
import com.axway.apim.lib.error.AppException; | ||
import com.axway.apim.users.lib.cli.UserExportCLIOptions; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.PrintStream; | ||
|
||
public class UserExportCLIOptionsTest { | ||
|
||
@Test | ||
public void printUsage() throws AppException { | ||
PrintStream old = System.out; | ||
String[] args = {"-s", "prod", "-id", "UUID-ID-OF-THE-USER", "-loginName", "*mark24*", "-n", "*Mark*", "-email", "*@axway.com*", "-type", "external", "-org", "*Partner*", "-role", "oadmin", "-state", "pending", "-enabled", "false", "-o", "json"}; | ||
CLIOptions options = UserExportCLIOptions.create(args); | ||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | ||
System.setOut(new PrintStream(byteArrayOutputStream)); | ||
options.printUsage("test", args); | ||
System.setOut(old); | ||
Assert.assertTrue(byteArrayOutputStream.toString().contains("-id UUID-ID-OF-THE-USER")); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
modules/users/src/test/java/com/axway/apim/user/cli/UserImportCLIOptionsTest.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,25 @@ | ||
package com.axway.apim.user.cli; | ||
|
||
import com.axway.apim.lib.CLIOptions; | ||
import com.axway.apim.lib.error.AppException; | ||
import com.axway.apim.users.lib.cli.UserImportCLIOptions; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.PrintStream; | ||
|
||
public class UserImportCLIOptionsTest { | ||
|
||
@Test | ||
public void printUsage() throws AppException { | ||
PrintStream old = System.out; | ||
String[] args = {"-s", "prod", "-c", "myUserConfig.json"}; | ||
CLIOptions options = UserImportCLIOptions.create(args); | ||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | ||
System.setOut(new PrintStream(byteArrayOutputStream)); | ||
options.printUsage("test", args); | ||
System.setOut(old); | ||
Assert.assertTrue(byteArrayOutputStream.toString().contains("-c myUserConfig.json")); | ||
} | ||
} |