I'm kind of new to Groovy and now rework JS script to Groovy in JMeter. I've got persistent error No signature of method: static java.lang.String.ValueOf() is applicable for argument types: (java.lang.String) values: [1572245927833] when run in code below in JSR223 Groovy in JMeter, the error for line number with return statement:
def clientTransactionIdGen() {
String timestamp = new Date().getTime().toString();
def rand = get_random(1000000, 9999999);
def user_id = vars.get("user_id");
return timestamp + String.valueOf(rand) + '^' + user_id;
}
1572245927833 is time in seconds (so timestamp variable) and there is no ValueOf() conversion in line with return statement. I even changed timestamp type from def to String, still error points to line with return statement. Why such error in such place? As I understand there is a try to convert already string object to String. Why? The same error actually is when I have timestamp as long and convert in return line, also a puzzle to me:
def clientTransactionIdGen() {
def timestamp = new Date().getTime();
def rand = get_random(1000000, 9999999);
def user_id = vars.get("user_id");
return String.valueOf(timestamp) + String.valueOf(rand) + '^' + user_id;
}
ADDED: per good remarks changed all ValueOf to valueOf in all script, still the error as above stays and says: No signature of method: static java.lang.String.ValueOf()
ADDED: solved after reload of JMeter, apparently something remained cached and did not allow for proper debugging.
String.ValueOf()->String.valueOf(): it's case-sensitive