spock

spock

文章 0 浏览 4

Groovy- Spock数据表期望值

我有一种使用SPOCK编写单元测试的方法。此方法将两个字符串作为输入,并返回一个可以基于方法中的某些条件(基本上是字符串比较器)的整数值,> 0…

仙气飘飘 2025-02-13 08:01:24 0 0

spock:验证互动不起作用 - 调用太少

我有一个非常简单的类,如上所述, class MyClass { public static String getName(String input) { return toUpperCase(input); } public static Str…

分開簡單 2025-02-12 08:53:14 0 0

Groovy语法和可变?

1 * subject.statusRepository.save({ it.Id == request.Id it.location == location it.team == statusExisting.getTeam() it.statusEnum == StatusE…

寂寞笑我太脆弱 2025-02-10 03:21:48 1 0

hamcrest Matchers.equalto在GSTRING上报告false到字符串比较

我有一个列表,其中包含一个值一个gstring的参数。当我通过hamcrest进行比较时,我会得到字符串,即使与字符串进行比较时,即使内容匹配 , 在比较期…

两个我 2025-02-07 17:28:25 2 0

Spock-构造函数中的通配符

例如在Kotlin中 data class SomeClass(val a: String, val b: String, val c: String) 我有这样的课程( 一些字段,类似的东西: 1 * someService.doS…

舞袖。长 2025-02-06 06:18:03 1 0

如何增加SPOCK框架的内存尺寸?

Java程序运行良好,但测试失败了消息: Caused by: java.lang.OutOfMemoryError: Java heap space at java.base/java.util.BitSet.initWords(BitSet.j…

笙痞 2025-02-05 17:53:13 3 0

如何与Spock一起模拟静态变量和构建器?

public class MyLogger { @ConfigProperty(name = "application.version") String appVersion; public static final LogContext logContext = LogCont…

枕花眠 2025-02-05 17:22:44 2 0

Stepverifier :: Expecterror接受Spock中的任何例外

我正在测试使用Spring Boot的WebFlux库的类,并且我遇到了 stepverifier :: Expecterror 的奇怪行为。具体来说,我可以将任何任何类型(甚至字符串!…

且行且努力 2025-02-05 15:24:10 2 0

带有spock的模拟fileinputstream()

我有以下方法,我需要用SPOCK编写单元测试。 private Credentials getCredentials() throws IOException { return GoogleCredentials.fromStream(new …

霊感 2025-02-05 15:16:26 1 0

需要涵盖urlencoder.encode的undupportedEncodingException。

我需要介绍 unduportedEncodingException urlencoder.encode ,但没有例外。 我的代码是; try { return URLEncoder.encode("!@#", "UTF-8"); } catch…

贱贱哒 2025-02-04 02:59:46 2 0

添加断点时,spock unebing rettemplate起作用

我正在用Spock编写一个单元测试,并试图使用Stub RESTTEMPLATE.POSTFORENTITY(),但是看到一个奇怪的问题,即仅在我添加断点并评估表达式时,该存根…

勿忘初心 2025-02-03 12:59:30 3 0

想要嘲笑“ logger.isdebugenabled()”在凹槽中为虚假

想从groovy spock logger.isDebugEnabled() >> false 。 import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cor…

恋你朝朝暮暮 2025-02-03 06:08:19 1 0

想要嘲笑“ logger.isdebugenabled()”在凹槽中为虚假

想从groovy spock logger.isDebugEnabled() >> false 。 import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cor…

神回复 2025-02-02 15:51:20 2 0

为什么我的应用程序的春季启动应用程序干扰了Adobe的另一个Spring Boot应用程序

上下文是我使用s3mock-junit5使用Groovy的Spock框架嘲笑S3, testImplementation group: 'com.adobe.testing', name: 's3mock-junit5', version: '2.4…

咋地 2025-01-31 13:26:09 1 0

用Spock添加身体为HTTP请求

我正在开发一个Spring Boot应用程序,并且正在尝试使用SPOCK和 groovyx.net.http.restclient 进行一些授权/身份验证测试。我试图将用户名和密码在身体…

巾帼英雄 2025-01-30 00:08:50 1 0
更多

推荐作者

十二

文章 0 评论 0

飞烟轻若梦

文章 0 评论 0

OPleyuhuo

文章 0 评论 0

wxb0109

文章 0 评论 0

旧城空念

文章 0 评论 0

-小熊_

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文