That's fine I might add it,
I am still getting an error, I have verified that I am getting a random number generated and stored in int but after I am getting below error,
Assertion name: Scripted Assertion checks for: false is of type: Assert by Script Execution.
Script, // This script should return a boolean result indicating the assertion is true or false
import java.util.concurrent.ThreadLocalRandom;
if (lisa_vse_response.get(0).getBodyText().equals("meta"))
{
int boundedRandomValue = ThreadLocalRandom.current().nextInt(1, 5);
lisa_vse_response.set(0,lisa_vse_response.get(boundedRandomValue));
}
return true; execution error so we assume false: javax.script.ScriptException: bsh.TargetError: Sourced file: inline evaluation of: ``// This script should return a boolean result indicating the assertion is true o . . . '' : Method Invocation lisa_vse_response.get : at Line: 7 : in file: inline evaluation of: ``// This script should return a boolean result indicating the assertion is true o . . . '' : lisa_vse_response .get ( boundedRandomValue )
Target exception: java.lang.IndexOutOfBoundsException: Index: 3, Size: 1
in inline evaluation of: ``// This script should return a boolean result indicating the assertion is true o . . . '' at line number 7
Original Message:
Sent: 08-29-2019 11:38 AM
From: Danny Saro
Subject: Virtual Service Matching response
My mistake, can you add the following line to the top of the script:
Import java.util.concurrent.ThreadLocalRandom;
Cheers,
Danny
::DISCLAIMER::
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Original Message------
yes, I mean to say I am getting the response as meta. but i can see the script is failing because of below error,
execution error so we assume false: javax.script.ScriptException: bsh.EvalError: Sourced file: inline evaluation of: ``// This script should return a boolean result indicating the assertion is true o . . . '' : Attempt to resolve method: current() on undefined variable or class name: ThreadLocalRandom : at Line: 4 : in file: inline evaluation of: ``// This script should return a boolean result indicating the assertion is true o . . . '' : ThreadLocalRandom .current ( )
in inline evaluation of: ``// This script should return a boolean result indicating the assertion is true o . . . '' at line number 4-------------------------------------------
i am using 10.5
Original Message:
Sent: 08-29-2019 11:24 AM
From: Danny Saro
Subject: Virtual Service Matching response
Can you put some vsi printscreens of your definition of the responses of your META transaction?
If you have replaced the first response of your META with the actual text "META" instead of a real response then I fail to see how you can get normal behaviour because your consumers would actually receive the text "META" as a response?
Cheers,
Danny
::DISCLAIMER::
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Original Message------
Hi Danny,
thanks for the reply.
I have added this scripted assertion and still, I can see normal behavior.
Best Regards,
Venkata Yedida