admin管理员组文章数量:1122846
I am very new to AWS SDK and trying to understand how to test their libraries. In this one, I am trying to retrieve the available ec2 instances which works fine. But I couldn't figure out a way to write unit tests for it.
import software.amazon.awssdk.services.ec2.Ec2Client
import software.amazon.awssdk.services.ec2.model.Instance
fun getEc2ResourceList(): MutableList<CloudResource> {
val ec2Response = ec2Client.describeInstances().reservations()
val instanceList = ArrayList<Instance>()
ec2Response.forEach {
it.instances().forEach { instance ->
instanceList.add(instance)
}
}
val ec2List: MutableList<CloudResource> = ArrayList()
for (instance in instanceList) {
// Some Mapping
ec2List.add(instance)
}
return ec2List
}
本文标签: amazon web servicesAWS SDK EC2 Client Unit Testing using KotlinStack Overflow
版权声明:本文标题:amazon web services - AWS SDK EC2 Client Unit Testing using Kotlin - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301470a1931186.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论