mirror of
https://github.com/LukeHagar/sailpoint-cli.git
synced 2025-12-06 12:47:44 +00:00
@@ -45,7 +45,7 @@ func newConnInitCommand() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if f, err := os.Stat(projName); err == nil && f.IsDir() && f.Name() == projName {
|
if f, err := os.Stat(projName); err == nil && f.IsDir() && f.Name() == projName {
|
||||||
printError(cmd.ErrOrStderr(), fmt.Errorf("error: project '%s' already exists.\n", projName))
|
printError(cmd.ErrOrStderr(), fmt.Errorf("Error: project '%s' already exists.\n", projName))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ func TestNewConnInitCmd_emptyName(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(string(out), "connector name cannot be empty") {
|
if !strings.Contains(string(out), "connector name cannot be empty") {
|
||||||
t.Errorf("expected: %s, actual: %s", "error: connector name cannot be empty", string(out))
|
t.Errorf("expected: %s, actual: %s", "Error: connector name cannot be empty", string(out))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ func TestNewConnInitCmd(t *testing.T) {
|
|||||||
t.Fatalf("error read out: %v", err)
|
t.Fatalf("error read out: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(string(out), "successfully created project") {
|
if !strings.Contains(string(out), "Successfully created project") {
|
||||||
t.Errorf("expected out to contain '%s', actual: %s", "successfully created project", string(out))
|
t.Errorf("expected out to contain '%s', actual: %s", "Successfully created project", string(out))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ func invokeConfig(cmd *cobra.Command) (json.RawMessage, error) {
|
|||||||
configJSONFlag := cmd.Flags().Lookup("config-json")
|
configJSONFlag := cmd.Flags().Lookup("config-json")
|
||||||
|
|
||||||
if (configPathFlag == nil || configPathFlag.Value.String() == "") && (configJSONFlag == nil || configJSONFlag.Value.String() == "") {
|
if (configPathFlag == nil || configPathFlag.Value.String() == "") && (configJSONFlag == nil || configJSONFlag.Value.String() == "") {
|
||||||
return nil, fmt.Errorf("either config-path or config-json must be set")
|
return nil, fmt.Errorf("Either config-path or config-json must be set")
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.Flags().Lookup("config-json") != nil && cmd.Flags().Lookup("config-json").Value.String() != "" {
|
if cmd.Flags().Lookup("config-json") != nil && cmd.Flags().Lookup("config-json").Value.String() != "" {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ func TestInvokeConfig(t *testing.T) {
|
|||||||
cmd.Flags().String("config-json", "", "")
|
cmd.Flags().String("config-json", "", "")
|
||||||
|
|
||||||
_, err := invokeConfig(cmd)
|
_, err := invokeConfig(cmd)
|
||||||
expectedErr := fmt.Errorf("either config-path or config-json must be set")
|
expectedErr := fmt.Errorf("Either config-path or config-json must be set")
|
||||||
if err.Error() != expectedErr.Error() {
|
if err.Error() != expectedErr.Error() {
|
||||||
t.Fatalf("expected err: %s, actual: %s", expectedErr, err)
|
t.Fatalf("expected err: %s, actual: %s", expectedErr, err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ func newCustomizerInitCmd() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if f, err := os.Stat(projName); err == nil && f.IsDir() && f.Name() == projName {
|
if f, err := os.Stat(projName); err == nil && f.IsDir() && f.Name() == projName {
|
||||||
printError(cmd.ErrOrStderr(), fmt.Errorf("error: project '%s' already exists.\n", projName))
|
printError(cmd.ErrOrStderr(), fmt.Errorf("Error: project '%s' already exists.\n", projName))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func newCreateCommand() *cobra.Command {
|
|||||||
log.Debug("Transform", "transform", transform)
|
log.Debug("Transform", "transform", transform)
|
||||||
|
|
||||||
if transform.GetName() == "" {
|
if transform.GetName() == "" {
|
||||||
return fmt.Errorf("transform must have a name")
|
return fmt.Errorf("The transform must have a name")
|
||||||
}
|
}
|
||||||
|
|
||||||
apiClient, err := config.InitAPIClient()
|
apiClient, err := config.InitAPIClient()
|
||||||
|
|||||||
@@ -143,14 +143,14 @@ func newPreviewCommand() *cobra.Command {
|
|||||||
accountAttName = def.Input.Attributes.AttributeName
|
accountAttName = def.Input.Attributes.AttributeName
|
||||||
sourceName = def.Input.Attributes.SourceName
|
sourceName = def.Input.Attributes.SourceName
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("unknown transform definition encountered when parsing identity profile: " + transType)
|
return fmt.Errorf("Unknown transform definition encountered when parsing identity profile: " + transType)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
name := cmd.Flags().Lookup("name").Value.String()
|
name := cmd.Flags().Lookup("name").Value.String()
|
||||||
if name == "" {
|
if name == "" {
|
||||||
return fmt.Errorf("transform name must be specified when previewing with implicit input")
|
return fmt.Errorf("the transform name must be specified when previewing with implicit input")
|
||||||
}
|
}
|
||||||
|
|
||||||
previewBody := transmodel.MakePreviewBodyImplicit(attribute, name, accountAttName, sourceName)
|
previewBody := transmodel.MakePreviewBodyImplicit(attribute, name, accountAttName, sourceName)
|
||||||
|
|||||||
Reference in New Issue
Block a user