-
Notifications
You must be signed in to change notification settings - Fork 20
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
Showing
6 changed files
with
123 additions
and
9 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
54 changes: 54 additions & 0 deletions
54
...-functional-test/src/ftest/groovy/com/fortify/cli/ftest/sc_dast/SCDastRestCallSpec.groovy
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,54 @@ | ||
/** | ||
* Copyright 2023 Open Text. | ||
* | ||
* The only warranties for products and services of Open Text | ||
* and its affiliates and licensors ("Open Text") are as may | ||
* be set forth in the express warranty statements accompanying | ||
* such products and services. Nothing herein should be construed | ||
* as constituting an additional warranty. Open Text shall not be | ||
* liable for technical or editorial errors or omissions contained | ||
* herein. The information contained herein is subject to change | ||
* without notice. | ||
*/ | ||
package com.fortify.cli.ftest.sc_dast | ||
|
||
import static com.fortify.cli.ftest._common.spec.FcliSessionType.SCDAST | ||
import static com.fortify.cli.ftest._common.spec.FcliSessionType.SCSAST | ||
|
||
import com.fortify.cli.ftest._common.Fcli | ||
import com.fortify.cli.ftest._common.spec.FcliBaseSpec | ||
import com.fortify.cli.ftest._common.spec.FcliSession | ||
import com.fortify.cli.ftest._common.spec.Prefix | ||
import com.fortify.cli.ftest.ssc._common.SSCAppVersion | ||
|
||
import spock.lang.AutoCleanup | ||
import spock.lang.Shared | ||
|
||
@Prefix("sc-sast.rest.call") @FcliSession(SCDAST) | ||
class SCDastRestCallSpec extends FcliBaseSpec { | ||
def "user-permissions"() { | ||
def args = ["sc-dast", "rest", "call", "/api/v2/auth/user-permissions"] | ||
when: | ||
def result = Fcli.run(args) | ||
then: | ||
verifyAll(result.stdout) { | ||
size()>0 | ||
it[0] == '---' | ||
it[1].startsWith '-' | ||
it.any { it =~ 'username' } | ||
it.any { it =~ 'permissions' } | ||
} | ||
} | ||
|
||
def "transform-no-paging"() { | ||
def args = ["sc-dast", "rest", "call", "-X", "GET", "/api/v2/applications?limit=1", "--no-paging", '-t', 'items.![{x: id}]'] | ||
when: | ||
def result = Fcli.run(args) | ||
then: | ||
verifyAll(result.stdout) { | ||
size()==2 | ||
it[0] == '---' | ||
it[1].startsWith '- x:' | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...-functional-test/src/ftest/groovy/com/fortify/cli/ftest/sc_sast/SCSastRestCallSpec.groovy
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,39 @@ | ||
/** | ||
* Copyright 2023 Open Text. | ||
* | ||
* The only warranties for products and services of Open Text | ||
* and its affiliates and licensors ("Open Text") are as may | ||
* be set forth in the express warranty statements accompanying | ||
* such products and services. Nothing herein should be construed | ||
* as constituting an additional warranty. Open Text shall not be | ||
* liable for technical or editorial errors or omissions contained | ||
* herein. The information contained herein is subject to change | ||
* without notice. | ||
*/ | ||
package com.fortify.cli.ftest.sc_sast | ||
|
||
import static com.fortify.cli.ftest._common.spec.FcliSessionType.SCSAST | ||
|
||
import com.fortify.cli.ftest._common.Fcli | ||
import com.fortify.cli.ftest._common.spec.FcliBaseSpec | ||
import com.fortify.cli.ftest._common.spec.FcliSession | ||
import com.fortify.cli.ftest._common.spec.Prefix | ||
import com.fortify.cli.ftest.ssc._common.SSCAppVersion | ||
|
||
import spock.lang.AutoCleanup | ||
import spock.lang.Shared | ||
|
||
@Prefix("sc-sast.rest.call") @FcliSession(SCSAST) | ||
class SCSastRestCallSpec extends FcliBaseSpec { | ||
def "ping"() { | ||
def args = ["sc-sast", "rest", "call", "/rest/v2/ping"] | ||
when: | ||
def result = Fcli.run(args) | ||
then: | ||
verifyAll(result.stdout) { | ||
size()==2 | ||
it[0] == '---' | ||
it[1] =~ '- message: ".* I am still alive."' | ||
} | ||
} | ||
} |
9 changes: 8 additions & 1 deletion
9
...fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/sc_sast/SCSastScanSpec.groovy
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