本文整理匯總了Java中io.swagger.models.Operation.vendorExtensions方法的典型用法代碼示例。如果您正苦於以下問題:Java Operation.vendorExtensions方法的具體用法?Java Operation.vendorExtensions怎麽用?Java Operation.vendorExtensions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.swagger.models.Operation
的用法示例。
在下文中一共展示了Operation.vendorExtensions方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: map_BodyParameter
import io.swagger.models.Operation; //導入方法依賴的package包/類
@Test
public void map_BodyParameter() throws IOException {
// Arrange
Property property = mock(Property.class);
List<Parameter> parameters = createBodyParameter("object");
Operation newOp = new Operation();
newOp.setParameters(parameters);
newOp.vendorExtensions(ImmutableMap.of(OpenApiSpecificationExtensions.INFORMATION_PRODUCT,
DBEERPEDIA.BREWERIES.stringValue()));
newOp.response(200, new Response().schema(property));
mockDefinition().host(DBEERPEDIA.OPENAPI_HOST).produces(MediaType.APPLICATION_JSON).path(
"/breweries", new Path().get(newOp));
// Act
requestMapper.map(httpConfigurationMock);
// Assert
verify(httpConfigurationMock).registerResources(resourceCaptor.capture());
Resource resource = resourceCaptor.getValue();
assertThat(resource.getPath(), equalTo("/" + DBEERPEDIA.OPENAPI_HOST + "/breweries"));
}
示例2: map_BodyParameterWithRefObject
import io.swagger.models.Operation; //導入方法依賴的package包/類
@Test
public void map_BodyParameterWithRefObject() throws IOException {
// Arrange
Property property = mock(Property.class);
List<Parameter> parameters = createBodyRefParameter();
Operation newOp = new Operation();
newOp.setParameters(parameters);
newOp.vendorExtensions(ImmutableMap.of(OpenApiSpecificationExtensions.INFORMATION_PRODUCT,
DBEERPEDIA.BREWERIES.stringValue()));
newOp.response(200, new Response().schema(property));
mockDefinition().host(DBEERPEDIA.OPENAPI_HOST).produces(MediaType.APPLICATION_JSON).path(
"/breweries", new Path().post(newOp));
// Assert
thrown.expect(ConfigurationException.class);
thrown.expectMessage(String.format("No object property in body parameter"));
// Act
requestMapper.map(httpConfigurationMock);
}
示例3: map_BodyParameterNoObject
import io.swagger.models.Operation; //導入方法依賴的package包/類
@Test
public void map_BodyParameterNoObject() throws IOException {
// Arrange
Property property = mock(Property.class);
List<Parameter> parameters = createBodyParameter("object2");
Operation newOp = new Operation();
newOp.setParameters(parameters);
newOp.vendorExtensions(ImmutableMap.of(OpenApiSpecificationExtensions.INFORMATION_PRODUCT,
DBEERPEDIA.BREWERIES.stringValue()));
newOp.response(200, new Response().schema(property));
mockDefinition().host(DBEERPEDIA.OPENAPI_HOST).produces(MediaType.APPLICATION_JSON).path(
"/breweries", new Path().get(newOp));
// Assert
thrown.expect(ConfigurationException.class);
thrown.expectMessage(String.format("No object property in body parameter"));
// Act
requestMapper.map(httpConfigurationMock);
}