本文整理匯總了Java中io.vertx.core.MultiMap.caseInsensitiveMultiMap方法的典型用法代碼示例。如果您正苦於以下問題:Java MultiMap.caseInsensitiveMultiMap方法的具體用法?Java MultiMap.caseInsensitiveMultiMap怎麽用?Java MultiMap.caseInsensitiveMultiMap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.vertx.core.MultiMap
的用法示例。
在下文中一共展示了MultiMap.caseInsensitiveMultiMap方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testArrayMulti
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test()
public void testArrayMulti() {
String name = "myName";
SerializableParameter parameter = new QueryParameter();
parameter.setName("myName");
parameter.setType("array");
parameter.setCollectionFormat("multi");
List<String> paramsList = new ArrayList<>();
paramsList.add("toto");
paramsList.add("tutu");
paramsList.add("titi");
MultiMap params = MultiMap.caseInsensitiveMultiMap();
params.add(name, paramsList);
Object result = abstractSerializableParameterExtractor.extract(name, parameter, params);
Assert.assertArrayEquals(paramsList.toArray(), ((List) result).toArray());
}
示例2: getActionContext
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
public ActionContext getActionContext(String query) {
MultiMap params = MultiMap.caseInsensitiveMultiMap();
for (Entry<String, String> entry : HttpQueryUtils.splitQuery(query).entrySet()) {
params.add(entry.getKey(), entry.getValue());
}
ActionContext mock = Mockito.mock(ActionContext.class);
Mockito.when(mock.getParameters()).thenReturn(params);
Mockito.when(mock.getParameter(Mockito.anyString())).thenAnswer(answer -> {
String key = (String) answer.getArguments()[0];
return params.get(key);
});
return mock;
}
示例3: testGetHeader
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void testGetHeader() {
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
headers.add("name", "value");
new Expectations() {
{
clientRequest.headers();
result = headers;
}
};
Assert.assertEquals("value", request.getHeader("name"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:14,代碼來源:TestVertxClientRequestToHttpServletRequest.java
示例4: testGetHeaders
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void testGetHeaders() {
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
headers.add("name", "value");
new Expectations() {
{
clientRequest.headers();
result = headers;
}
};
Assert.assertThat(Collections.list(request.getHeaders("name")), Matchers.contains("value"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:14,代碼來源:TestVertxClientRequestToHttpServletRequest.java
示例5: testGetHeaderNames
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void testGetHeaderNames() {
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
headers.add("name", "value");
new Expectations() {
{
clientRequest.headers();
result = headers;
}
};
Assert.assertThat(Collections.list(request.getHeaderNames()), Matchers.contains("name"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:14,代碼來源:TestVertxClientRequestToHttpServletRequest.java
示例6: testSetHeader
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void testSetHeader() {
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
new Expectations() {
{
clientRequest.headers();
result = headers;
}
};
request.setHeader("name", "v1");
request.setHeader("name", "v2");
Assert.assertThat(headers.getAll("name"), Matchers.contains("v2"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:16,代碼來源:TestVertxClientRequestToHttpServletRequest.java
示例7: testAddHeader
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void testAddHeader() {
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
new Expectations() {
{
clientRequest.headers();
result = headers;
}
};
request.addHeader("name", "v1");
request.addHeader("name", "v2");
Assert.assertThat(headers.getAll("name"), Matchers.contains("v1", "v2"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:15,代碼來源:TestVertxClientRequestToHttpServletRequest.java
示例8: getHeaders
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void getHeaders() {
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
headers.add("name", "v1");
headers.add("name", "v2");
new Expectations() {
{
clientResponse.headers();
result = headers;
}
};
Assert.assertThat(response.getHeaders("name"), Matchers.contains("v1", "v2"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:15,代碼來源:TestVertxClientResponseToHttpServletResponse.java
示例9: getHeaderNames
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void getHeaderNames() {
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
headers.add("n1", "v1");
headers.add("n2", "v2");
new Expectations() {
{
clientResponse.headers();
result = headers;
}
};
Assert.assertThat(response.getHeaderNames(), Matchers.contains("n1", "n2"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:15,代碼來源:TestVertxClientResponseToHttpServletResponse.java
示例10: testGetParameterValuesNormal
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void testGetParameterValuesNormal() {
MultiMap params = MultiMap.caseInsensitiveMultiMap();
params.add("name", "value");
new Expectations() {
{
vertxRequest.params();
result = params;
}
};
Assert.assertThat(request.getParameterValues("name"), Matchers.arrayContaining("value"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:15,代碼來源:TestVertxServerRequestToHttpServletRequest.java
示例11: testGetHeaders
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void testGetHeaders() {
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
headers.add("name", "value");
new Expectations() {
{
vertxRequest.headers();
result = headers;
}
};
Assert.assertThat(Collections.list(request.getHeaders("name")), Matchers.contains("value"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:14,代碼來源:TestVertxServerRequestToHttpServletRequest.java
示例12: testGetHeaderNames
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Test
public void testGetHeaderNames() {
MultiMap headers = MultiMap.caseInsensitiveMultiMap();
headers.add("name", "value");
new Expectations() {
{
vertxRequest.headers();
result = headers;
}
};
Assert.assertThat(Collections.list(request.getHeaderNames()), Matchers.contains("name"));
}
開發者ID:apache,項目名稱:incubator-servicecomb-java-chassis,代碼行數:15,代碼來源:TestVertxServerRequestToHttpServletRequest.java
示例13: headers
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Override
public MultiMap headers() {
if (headers == null) {
headers = MultiMap.caseInsensitiveMultiMap();
JsonObject requestHeaders = request.getJsonObject("headers");
if (requestHeaders != null) {
for (Map.Entry<String, Object> entry : requestHeaders) {
headers.add(entry.getKey(), entry.getValue().toString());
}
}
}
return headers;
}
示例14: formAttributes
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Override
public MultiMap formAttributes() {
if (attributes == null) {
attributes = MultiMap.caseInsensitiveMultiMap();
}
return attributes;
}
示例15: headers
import io.vertx.core.MultiMap; //導入方法依賴的package包/類
@Override
public MultiMap headers() {
if (headers == null) {
headers = MultiMap.caseInsensitiveMultiMap();
}
return headers;
}