Class VirtualServiceUtil


  • @Service("virtualServiceUtil")
    public class VirtualServiceUtil
    extends java.lang.Object
    This class is base utility service class to perform all virtual service operations
    Author:
    Elan Thangamani
    • Constructor Detail

      • VirtualServiceUtil

        public VirtualServiceUtil()
    • Method Detail

      • getActualValue

        public static java.lang.Object getActualValue​(java.lang.Object object,
                                                      java.util.Map<java.lang.String,​java.lang.Object> contextObject)
      • setVirtualServiceType

        public void setVirtualServiceType​(VirtualServiceType virtualServiceType)
      • init

        @PostConstruct
        @Order(1)
        public void init()
                  throws java.lang.ClassNotFoundException,
                         com.fasterxml.jackson.core.JsonProcessingException,
                         java.lang.InstantiationException,
                         java.lang.IllegalAccessException
        Throws:
        java.lang.ClassNotFoundException
        com.fasterxml.jackson.core.JsonProcessingException
        java.lang.InstantiationException
        java.lang.IllegalAccessException
      • getHttpStatusMap

        public java.util.Map<java.lang.String,​java.lang.String> getHttpStatusMap()
      • readDynamicResponse

        public java.util.Map<MockRequest,​MockResponse> readDynamicResponse​(java.lang.String resource,
                                                                                 java.lang.String operationId)
      • findOperationIdForService

        public void findOperationIdForService​(VirtualServiceRequest mockLoadRequest)
      • checkIfServiceDataAlreadyExists

        public org.springframework.http.ResponseEntity<VirtualServiceStatus> checkIfServiceDataAlreadyExists​(VirtualServiceRequest virtualServiceRequest)
                                                                                                      throws java.io.IOException,
                                                                                                             javax.xml.bind.JAXBException
        Throws:
        java.io.IOException
        javax.xml.bind.JAXBException
      • getVirtualServiceStatusResponseEntity

        public org.springframework.http.ResponseEntity<VirtualServiceStatus> getVirtualServiceStatusResponseEntity​(VirtualServiceRequest virtualServiceRequest,
                                                                                                                   java.lang.Long response)
      • isMockAlreadyExists

        public java.lang.Object isMockAlreadyExists​(VirtualServiceRequest mockTransferObject)
                                             throws java.io.IOException,
                                                    javax.xml.bind.JAXBException
        Throws:
        java.io.IOException
        javax.xml.bind.JAXBException
      • isResponseExists

        public java.util.Map<java.lang.Integer,​ReturnMockResponse> isResponseExists​(java.util.Map<MockRequest,​MockResponse> mockDataSetupMap,
                                                                                          MockServiceRequest mockServiceRequest)
                                                                                   throws java.io.IOException,
                                                                                          javax.xml.bind.JAXBException
        Throws:
        java.io.IOException
        javax.xml.bind.JAXBException
      • returnResponse

        public java.lang.Object returnResponse​(java.lang.reflect.Method method,
                                               MockServiceRequest mockServiceRequest)
                                        throws java.io.IOException,
                                               javax.xml.bind.JAXBException
        Throws:
        java.io.IOException
        javax.xml.bind.JAXBException
      • getResponse

        public java.lang.Object getResponse​(java.lang.reflect.Method method,
                                            java.util.List<ReturnMockResponse> returnMockResponseList)
                                     throws javax.xml.bind.JAXBException
        Throws:
        javax.xml.bind.JAXBException