-
-
Save braghome/77a79a317c9f607b5c1d to your computer and use it in GitHub Desktop.
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
override verifyProfileName(String agentPartnerId, List<UserProfile<Data>> uData) throws AssertionError { | |
val p = userProfileImpl.getProdUserProfleService( | |
Z.toString + agentPartnerId | |
) | |
LOGGER.info('''matched user profile should have z id «p.data.zuid» name «p.data.name»''') | |
try { | |
assertThat(p, notNullValue) | |
} catch (AssertionError ae) { | |
throw new AssertionError(ae.getMessage, ae.getCause) | |
} | |
val s = !p.data.name.isEmpty | |
if (s) uData.add(p) | |
LOGGER.info('''matched user data should have z id «uData.last.data.zuid» name «uData.last.data.name»''') | |
s | |
} | |
def private matchPfrofileName(UserProfile<Data> d) throws AssertionError { | |
try { | |
assertThat('''matched user profile should not be null «d»''', d, notNullValue) | |
} catch (AssertionError ae) { | |
throw new AssertionError(ae.getMessage, ae.getCause) | |
} | |
d | |
} | |
override validateMailbox(CrmAgent a, List<UserProfile<Data>> ud) throws AssertionError { | |
val removeSpace = matchPfrofileName(ud.findFirst[x | { | |
val s = x.data.zuid.toString | |
val part = a.partnerId | |
LOGGER.info('''matched user profile «part» should equal z id «s»''') | |
x.data.zuid.toString == a.partnerId }]).data | |
.name | |
.toLowerCase | |
try { | |
assertThat(removeSpace, notNullValue) | |
assertThat(a.mailbox, equalTo(removeSpace.replaceAll("[^a-zA-Z0-9]", ""))) | |
} catch (AssertionError ae) { | |
throw new AssertionError(ae.getMessage, ae.getCause) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment