当前位置: 首页>>代码示例>>Java>>正文


Java Form.put方法代码示例

本文整理汇总了Java中com.sun.jersey.api.representation.Form.put方法的典型用法代码示例。如果您正苦于以下问题:Java Form.put方法的具体用法?Java Form.put怎么用?Java Form.put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.jersey.api.representation.Form的用法示例。


在下文中一共展示了Form.put方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test_filter_noActionOnPostFormPut

import com.sun.jersey.api.representation.Form; //导入方法依赖的package包/类
public void test_filter_noActionOnPostFormPut() {
  ContainerRequest mock = Mockito.mock(ContainerRequest.class);
  when(mock.getMethod()).thenReturn("POST");
  Form form = new Form();
  form.put("method", Arrays.asList("PUT"));
  when(mock.getFormParameters()).thenReturn(form);
  
  HttpMethodFilter test = new HttpMethodFilter();
  ContainerRequest result = test.filter(mock);
  
  assertSame(mock, result);
  verify(mock).getMethod();
  verify(mock).getFormParameters();
  verify(mock).setMethod("PUT");
  verifyNoMoreInteractions(mock);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:17,代码来源:HttpMethodFilterTest.java

示例2: test_filter_noActionOnPostFormDelete

import com.sun.jersey.api.representation.Form; //导入方法依赖的package包/类
public void test_filter_noActionOnPostFormDelete() {
  ContainerRequest mock = Mockito.mock(ContainerRequest.class);
  when(mock.getMethod()).thenReturn("POST");
  Form form = new Form();
  form.put("method", Arrays.asList("DELETE"));
  when(mock.getFormParameters()).thenReturn(form);
  
  HttpMethodFilter test = new HttpMethodFilter();
  ContainerRequest result = test.filter(mock);
  
  assertSame(mock, result);
  verify(mock).getMethod();
  verify(mock).getFormParameters();
  verify(mock).setMethod("DELETE");
  verifyNoMoreInteractions(mock);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:17,代码来源:HttpMethodFilterTest.java

示例3: test_filter_noActionOnPostFormOptions

import com.sun.jersey.api.representation.Form; //导入方法依赖的package包/类
public void test_filter_noActionOnPostFormOptions() {
  ContainerRequest mock = Mockito.mock(ContainerRequest.class);
  when(mock.getMethod()).thenReturn("POST");
  Form form = new Form();
  form.put("method", Arrays.asList("OPTIONS"));
  when(mock.getFormParameters()).thenReturn(form);
  
  HttpMethodFilter test = new HttpMethodFilter();
  ContainerRequest result = test.filter(mock);
  
  assertSame(mock, result);
  verify(mock).getMethod();
  verify(mock).getFormParameters();
  verify(mock).setMethod("OPTIONS");
  verifyNoMoreInteractions(mock);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:17,代码来源:HttpMethodFilterTest.java

示例4: test_filter_noActionOnPostFormHead

import com.sun.jersey.api.representation.Form; //导入方法依赖的package包/类
public void test_filter_noActionOnPostFormHead() {
  ContainerRequest mock = Mockito.mock(ContainerRequest.class);
  when(mock.getMethod()).thenReturn("POST");
  Form form = new Form();
  form.put("method", Arrays.asList("HEAD"));
  when(mock.getFormParameters()).thenReturn(form);
  
  HttpMethodFilter test = new HttpMethodFilter();
  ContainerRequest result = test.filter(mock);
  
  assertSame(mock, result);
  verify(mock).getMethod();
  verify(mock).getFormParameters();
  verify(mock).setMethod("HEAD");
  verifyNoMoreInteractions(mock);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:17,代码来源:HttpMethodFilterTest.java

示例5: test_filter_noActionOnPostFormPost

import com.sun.jersey.api.representation.Form; //导入方法依赖的package包/类
public void test_filter_noActionOnPostFormPost() {
  ContainerRequest mock = Mockito.mock(ContainerRequest.class);
  when(mock.getMethod()).thenReturn("POST");
  Form form = new Form();
  form.put("method", Arrays.asList("POST"));
  when(mock.getFormParameters()).thenReturn(form);
  
  HttpMethodFilter test = new HttpMethodFilter();
  ContainerRequest result = test.filter(mock);
  
  assertSame(mock, result);
  verify(mock).getMethod();
  verify(mock).getFormParameters();
  verify(mock).setMethod("POST");
  verifyNoMoreInteractions(mock);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:17,代码来源:HttpMethodFilterTest.java

示例6: test_filter_noActionOnPostFormGet

import com.sun.jersey.api.representation.Form; //导入方法依赖的package包/类
public void test_filter_noActionOnPostFormGet() {
  ContainerRequest mock = Mockito.mock(ContainerRequest.class);
  when(mock.getMethod()).thenReturn("POST");
  Form form = new Form();
  form.put("method", Arrays.asList("GET"));
  when(mock.getFormParameters()).thenReturn(form);
  
  HttpMethodFilter test = new HttpMethodFilter();
  ContainerRequest result = test.filter(mock);
  
  assertSame(mock, result);
  verify(mock).getMethod();
  verify(mock).getFormParameters();
  verify(mock).setMethod("GET");
  verifyNoMoreInteractions(mock);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:17,代码来源:HttpMethodFilterTest.java

示例7: test_filter_noActionOnPostFormNoMatch

import com.sun.jersey.api.representation.Form; //导入方法依赖的package包/类
public void test_filter_noActionOnPostFormNoMatch() {
  ContainerRequest mock = Mockito.mock(ContainerRequest.class);
  when(mock.getMethod()).thenReturn("POST");
  Form form = new Form();
  form.put("method", Arrays.asList("FOOBAR"));
  when(mock.getFormParameters()).thenReturn(form);
  
  HttpMethodFilter test = new HttpMethodFilter();
  ContainerRequest result = test.filter(mock);
  
  assertSame(mock, result);
  verify(mock).getMethod();
  verify(mock).getFormParameters();
  verifyNoMoreInteractions(mock);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:16,代码来源:HttpMethodFilterTest.java


注:本文中的com.sun.jersey.api.representation.Form.put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。