本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}