Giter Site home page Giter Site logo

virtualansoftware / service-virtualization-openapi Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 6.0 63.81 MB

Service virtualization is the simulation of the behavior of software components that are unavailable or otherwise restricted during the preproduction stage of the software development lifecycle. 

Home Page: https://live.virtualandemo.com/virtualan-ui

Java 4.10% Dockerfile 0.60% Gherkin 95.30%
automated-testing shift-left service-virtualization mocking mock-server mock-services stub stubbing stubs dynamic-mock testing microservice

service-virtualization-openapi's Introduction

Virtualan

Maven Central Build Status

Virtualan is an open source-based Open API Interface driven, Kafka, AMQ and MQTT Service virtualization product. It supports #OpenAPI, #AsyncAPI test development. This supports #shiftleft testing.

Product page: https://www.linkedin.com/products/virtualan-software-virtualan/

Tutorials: https://tutorials.virtualan.io/#/Virtualan

Example: https://github.com/virtualansoftware/service-virtualization-openapi

Video: https://www.youtube.com/watch?v=otTjbPxT0W8

Docker Image: https://hub.docker.com/r/virtualan/service-virtualization

II. Initial Set up your project for the Swagger Specification :

  • Why/How to store the mock data in the centralized place: It always provides a choice to choose your data base and configure(spring-jpa). Need to provide data base information in the Application.properties in the "src/main/resources" directory of your spring boot application: This would requires if you don't want to loose the existing mock data because as you redeploy the code the data would be lost.

  • In memory DB: (Eveny restart you lose the old data)

    • virtualan.datasource.driver-class-name=org.hsqldb.jdbcDriver
    • virtualan.datasource.jdbcurl=jdbc:hsqldb:mem:dataSource
    • virtualan.datasource.username=sa
    • virtualan.datasource.password=
  • Add the following entry for each Interface Spec/Yaml to be set up as mock service:

    • to setup "petstore.yaml" need to add following entry in the pom.xml. refer the pom.xml for reference
     <execution>
     	<id>pet-service-vs-api</id>
     	<goals>
     		<goal>generate</goal>
     	</goals>
     	<configuration>
     		<inputSpec>${project.basedir}/src/main/resources/META-INF/resources/yaml/PetStore/petstore.yaml</inputSpec>
     		<output>${project.basedir}/target/external/</output>
     		<apiPackage>org.openapitools.virtualan.api</apiPackage>
     		<modelPackage>org.openapitools.virtualan.to</modelPackage>
     		<generatorName>spring</generatorName>
     		<configOptions>
                                 <virtualService>true</virtualService>
                         </configOptions>
     	</configuration>
     </execution>

III. Navigate to root directory of the folder where pom.xml was present:

  • Build:

       - mvn clean install  
    
    • If you have any proxy issue use this command: mvn -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 clean install
  • Run using standalone JAR:

    • java -jar target/virtualan-pet.jar
  • To set up data:

    - Using Virtualan-UI:       
    	https://github.com/virtualansoftware/virtualan/wiki/Test-Data-Set-up-using-Virtualan
    
    - open API Contract: 
      https://github.com/virtualansoftware/virtualan/blob/master/modules/virtualan-plugin/src/main/resources/virtualservices.yaml
    
    
    - Using Virtualan-Rest service: for automation usecases
      https://github.com/virtualansoftware/virtualan-openapi-demo/blob/master/src/test/resources/features/demo/demo.feature
    
  • Invoke Virtualan UI:

service-virtualization-openapi's People

Contributors

dependabot[bot] avatar elans3 avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.