-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #481 from psmf22/develop
FoD test updates
- Loading branch information
Showing
7 changed files
with
390 additions
and
66 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
...unctional-test/src/ftest/groovy/com/fortify/cli/ftest/fod/FoDAccessControlRoleSpec.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,59 @@ | ||
package com.fortify.cli.ftest.fod; | ||
|
||
import static com.fortify.cli.ftest._common.spec.FcliSessionType.FOD | ||
|
||
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.fod._common.FoDWebAppSupplier | ||
import com.fortify.cli.ftest.fod._common.FoDUserSupplier | ||
import com.fortify.cli.ftest.fod._common.FoDUserGroupSupplier | ||
|
||
import spock.lang.AutoCleanup | ||
import spock.lang.Shared | ||
import spock.lang.Stepwise | ||
import spock.lang.Unroll | ||
|
||
@Prefix("fod.role") @FcliSession(FOD) @Stepwise | ||
class FoDAccessControlRoleSpec extends FcliBaseSpec { | ||
@Shared @AutoCleanup FoDUserSupplier user = new FoDUserSupplier() | ||
@Shared @AutoCleanup FoDUserGroupSupplier group = new FoDUserGroupSupplier() | ||
@Shared @AutoCleanup FoDWebAppSupplier app = new FoDWebAppSupplier() | ||
|
||
def "list"() { | ||
def args = "fod ac list-roles --store roles" | ||
when: | ||
def result = Fcli.run(args) | ||
then: | ||
verifyAll(result.stdout) { | ||
size()>=2 | ||
it[0].replace(' ', '').equals("IdName") | ||
} | ||
} | ||
|
||
def "updateUserRole"() { | ||
def args = "fod ac update-user ${user.get().userName} --lastname updatedLastname --firstname updatedFirstname --phone 5678 --role=Developer" | ||
when: | ||
def result = Fcli.run(args) | ||
then: | ||
verifyAll(result.stdout) { | ||
size()==2 | ||
} | ||
} | ||
|
||
def "verifyUpdated"() { | ||
|
||
def args = "fod ac get-user ${user.get().userName}" | ||
when: | ||
def result = Fcli.run(args) | ||
then: | ||
verifyAll(result.stdout) { | ||
size()>2 | ||
it[9].equals("roleName: \"Developer\"") | ||
} | ||
} | ||
|
||
|
||
} | ||
|
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
Oops, something went wrong.