本文整理汇总了Java中io.swagger.models.parameters.Parameter.setName方法的典型用法代码示例。如果您正苦于以下问题:Java Parameter.setName方法的具体用法?Java Parameter.setName怎么用?Java Parameter.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.swagger.models.parameters.Parameter
的用法示例。
在下文中一共展示了Parameter.setName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testUrlPathBuilder
import io.swagger.models.parameters.Parameter; //导入方法依赖的package包/类
@Test
public void testUrlPathBuilder() throws Exception {
Map<String, RestParam> paramMap = new HashMap<>();
Parameter pathParameter = new PathParameter();
pathParameter.setName("id");
RestParam oRestParam = new RestParam(0, pathParameter, int.class);
paramMap.put(oRestParam.getParamName(), oRestParam);
Parameter queryParameter = new QueryParameter();
queryParameter.setName("q");
oRestParam = new RestParam(1, queryParameter, String.class);
paramMap.put(oRestParam.getParamName(), oRestParam);
URLPathBuilder oURLPathBuilder = new URLPathBuilder("/root/{id}", paramMap);
Object[] args = new Object[] {100, "query"};
Assert.assertEquals("/root/100?q=query", oURLPathBuilder.createRequestPath(args));
Assert.assertEquals("/root/100", oURLPathBuilder.createPathString(args));
}
示例2: beforeClass
import io.swagger.models.parameters.Parameter; //导入方法依赖的package包/类
@BeforeClass
public static void beforeClass() {
restOperation = Mockito.mock(RestOperationMeta.class);
// clientRequest = Mockito.mock(RestClientRequest.class);
paramList = new ArrayList<>();
Parameter hp = new HeaderParameter();
hp.setName("header");
paramList.add(new RestParam(0, hp, int.class));
when(restOperation.getParamList()).thenReturn(paramList);
}
示例3: testCreate
import io.swagger.models.parameters.Parameter; //导入方法依赖的package包/类
@Test
public void testCreate() {
ParamValueProcessorCreator creator =
ParamValueProcessorCreatorManager.INSTANCE.findValue(PathProcessorCreator.PARAMTYPE);
Parameter parameter = new PathParameter();
parameter.setName("path");
ParamValueProcessor processor = creator.create(parameter, String.class);
Assert.assertEquals(PathProcessor.class, processor.getClass());
}
示例4: testCreate
import io.swagger.models.parameters.Parameter; //导入方法依赖的package包/类
@Test
public void testCreate() {
ParamValueProcessorCreator creator =
ParamValueProcessorCreatorManager.INSTANCE.findValue(QueryProcessorCreator.PARAMTYPE);
Parameter parameter = new QueryParameter();
parameter.setName("query");
ParamValueProcessor processor = creator.create(parameter, String.class);
Assert.assertEquals(QueryProcessor.class, processor.getClass());
}