此方法签名中第二个参数的正确 Mockito 匹配器是什么:
List<Something> findSomething(Object o, Integer... ids);
Run Code Online (Sandbox Code Playgroud)
我尝试了以下匹配器:
when(findSomething(any(), anyInt())).thenReturn(listOfSomething);
when(findSomething(any(), any())).thenReturn(listOfSomething);
Run Code Online (Sandbox Code Playgroud)
但 Mockito 没有为我创建代理,返回的List是空的。
我通过 GRPC 将数据发送到(我们称之为),IntegrationApi调用一个方法Foo。我需要从响应中读取标头值(我正在通信的 API 发送速率限制标头)。
我正在使用https://www.nuget.org/packages/Grpc.Core/
var metaData = new Metadata();
metadata.Add(new Metadata.Entry("Authorization", $"Bearer {apiKey}"));
var channel = new Channel("url to endpoint", new SslCredentials());
var client = new IntegrationApi(channel);
var callOptions = new CallOptions()
.WithHeaders(metadata)
.WithDeadline(DateTime.UtcNow.AddSeconds(15))
.WithWaitForReady(false);
var response = client.Foo(req, options);
Run Code Online (Sandbox Code Playgroud)
但response唯一给我的是基于文件的属性Foo.proto。
我该怎么做呢?
如何查询包含" - "符号的属性.
具体来说,我想执行此查询:
SELECT * FROM c.inside.abs-humid
Run Code Online (Sandbox Code Playgroud)
但这给了我一个错误.
在没有破折号的情况下查询属性工作得很好,我该怎么做?