Skip to content

Commit bd386bf

Browse files
committed
fixing testcase
1 parent 98b3efd commit bd386bf

File tree

1 file changed

+4
-9
lines changed
  • integration-tests/src/test/groovy/com/okta/sdk/tests/it/util

1 file changed

+4
-9
lines changed

integration-tests/src/test/groovy/com/okta/sdk/tests/it/util/Util.groovy

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,29 +123,24 @@ class Util {
123123
.findFirst().isPresent()
124124
}
125125

126-
static void assertUserNotInGroup(User user, Group group, GroupApi groupApi, int times, long delayInMilliseconds, boolean present = true) {
126+
static void assertUserNotInGroup(User user, Group group, GroupApi groupApi, int times, long delayInMilliseconds) {
127127
for (int ii = 0; ii < times; ii++) {
128-
129128
sleep(delayInMilliseconds)
130129

131130
boolean userIsPresent = StreamSupport.stream(
132131
groupApi.listGroupUsers(group.getId(), null, null).spliterator(), false
133132
).anyMatch { listUser -> listUser.id == user.id }
134133

135-
if ((present && userIsPresent) || (!present && !userIsPresent)) {
134+
if (!userIsPresent) {
136135
return
137136
}
138137
}
139138

140-
141-
if (present) {
142-
Assert.fail("User not found in group after ${times} attempts")
143-
} else {
144-
Assert.fail("User found in group after ${times} attempts")
145-
}
139+
Assert.fail("User found in group after ${times} attempts")
146140
}
147141

148142

143+
149144
static def ignoring = { Class<? extends Throwable> catchMe, Closure callMe ->
150145
try {
151146
callMe.call()

0 commit comments

Comments
 (0)