on 08-23-2023 6:08 PM
Dear All,
I've gone through numerous blogs, but they're outdated and haven't been helpful in testing Groovy scripts locally using IntelliJ. I'm hoping to get some assistance. Can someone provide guidance on testing a basic Groovy program that includes all classes from the package com.sap.gateway.ip.core.customdev.util including AttachmentWrapper and SoapHeader? I attempted to simulate the message class with support from the book of vadim.klimov and engswee.yeoh, but I'm eager to learn how to do the same for other classes. Is it possible to set up a full simulation environment for Groovy on our laptops using IntelliJ? Any help would be greatly appreciated.
Hi Michael
I haven't been following this closely, so I cannot comment on how to run your scripts locally. I will add an opinion about testing them, though.
Two things are happening in an SAP Cloud Integration script:
I would argue that you can't really test the former locally anyway. You might be able to approximate the runtime environment, but you won't know for sure until your code actually executes in the real runtime environment.
You can test the latter locally, though. You just need to structure your script around this distinction, so that you, for instance, perform that JSON parsing in a separate method. Such a method can then be unit tested locally using existing Java and Groovy tools.
Your testing in SAP Cloud Integration can then focus on the platform interaction, which is likely also much simpler than the main logic of your script.
Anyway, just my two euro cents on the topic 🙂
Regards,
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Morten - Thank you for the help. Yes, I will think about this and also some more options.
User | Count |
---|---|
78 | |
10 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.