@Test
public void testPathOperationComponent() throws URISyntaxException {

    String COMPONENT_NAME = "path_operation";
    Path outputDirectory = getOutputFile(COMPONENT_NAME);
    FileUtils.deleteQuietly(outputDirectory.toFile());
    //Given
    Path file = Paths.get(PathOperationComponentTest.class.getResource("/yaml/swagger_petstore.yaml").toURI());
    Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(file).build();
    Swagger swagger = converter.getContext().getSchema();
    io.swagger.models.Path path = swagger.getPaths().get("/pets");
    List<SwaggerPathOperation> pathOperations = PathUtils.toPathOperationsList("/pets", path);
    Swagger2MarkupConverter.SwaggerContext context = converter.getContext();
    MarkupDocBuilder markupDocBuilder = context.createMarkupDocBuilder();
    //When
    markupDocBuilder = new PathOperationComponent(context,
            new DefinitionDocumentResolverFromOperation(context),
            new SecurityDocumentResolver(context)).
            apply(markupDocBuilder, PathOperationComponent.parameters(pathOperations.get(0)));
    markupDocBuilder.writeToFileWithoutExtension(outputDirectory, StandardCharsets.UTF_8);
    //Then
    Path expectedFile = getExpectedFile(COMPONENT_NAME);
    DiffUtils.assertThatFileIsEqual(expectedFile, outputDirectory, getReportName(COMPONENT_NAME));
}