Skip to content

Commit

Permalink
More tests for Application and PolicyRules objects
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiishamrai-okta committed Nov 23, 2020
1 parent 1d572de commit b6d6a3a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package com.okta.sdk.tests.it

import com.okta.sdk.client.Client
import com.okta.sdk.resource.ResourceException

import com.okta.sdk.resource.application.*
import com.okta.sdk.resource.group.Group
import com.okta.sdk.resource.group.GroupBuilder
Expand All @@ -26,9 +25,8 @@ import com.okta.sdk.tests.it.util.ITSupport
import org.testng.Assert
import org.testng.annotations.Test

import static com.okta.sdk.tests.it.util.Util.assertPresent
import static com.okta.sdk.tests.it.util.Util.assertNotPresent

import static com.okta.sdk.tests.it.util.Util.assertPresent
import static org.hamcrest.MatcherAssert.assertThat
import static org.hamcrest.Matchers.*

Expand Down Expand Up @@ -410,6 +408,10 @@ class ApplicationsIT extends ITSupport {
assertThat(groupAssignment.priority, equalTo(2))
assertThat(app.listGroupAssignments().iterator().size(), equalTo(1))

ApplicationGroupAssignment receivedGroupAssignment = app.getApplicationGroupAssignment(group.getId())
assertThat(groupAssignment.getId(), equalTo(receivedGroupAssignment.getId()))
assertThat(groupAssignment.getPriority(), equalTo(receivedGroupAssignment.getPriority()))

// delete the assignment
groupAssignment.delete()
assertThat(app.listGroupAssignments().iterator().size(), equalTo(0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ class PolicyRulesIT extends ITSupport implements CrudTestSupport {
assertThat(policyRule.getStatus(), is(PolicyRule.StatusEnum.INACTIVE))
}

@Test
void listPolicyRulesTest() {
def group = randomGroup()
def policy = randomSignOnPolicy(group.getId())

policy.listPolicyRules().forEach({policyItem ->
assertThat(policyItem, notNullValue())
assertThat(policyItem.getId(), notNullValue())
assertThat(policyItem, instanceOf(Policy.class))
})
}

@Test
void createPasswordPolicyRule() {

Expand Down

0 comments on commit b6d6a3a

Please sign in to comment.