Commit 4d78a549 authored by sgandhi@nisum.com's avatar sgandhi@nisum.com

EPE-006 : Added integration test cases

parent 94ffb6c5
package com.nisum.offertransactionservice.service;
package com.nisum.offertransactionservice.genericexception;
import feign.FeignException;
import lombok.AllArgsConstructor;
......
package com.nisum.offertransactionservice.handler;
import com.nisum.offertransactionservice.service.CustomCreatedCustomException;
import com.nisum.offertransactionservice.genericexception.CustomCreatedCustomException;
import org.json.JSONObject;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
......
package com.nisum.offertransactionservice.service;
import com.nisum.offertransactionservice.client.StoreProducerFeignClient;
import com.nisum.offertransactionservice.genericexception.CustomCreatedCustomException;
import com.nisum.offertransactionservice.genericexception.GlobalApiGenericException;
import feign.FeignException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
......@@ -26,10 +28,14 @@ public class EndOfTransactionService {
log.error("Offer transaction uuid is empty or null");
throw new GlobalApiGenericException("Unable to get the Offer transaction uuid ", new Exception("exception e"), "400", false);
}
log.info("Store Consumer WebClient call Start");
ResponseEntity<String> endOfTransactionRes = storeProducerFeignClient.callStoreProducer(uuid);
log.debug("Store consumer WebClient call End");
return endOfTransactionRes.getBody();
log.info("Store Consumer Feignclient call Start");
try{
ResponseEntity<String> endOfTransactionRes = storeProducerFeignClient.callStoreProducer(uuid);
log.debug("Store consumer Feignclient call End");
return endOfTransactionRes.getBody();
}catch (FeignException e){
throw new CustomCreatedCustomException(e.status(),e.contentUTF8());
}
}
......
......@@ -2,18 +2,17 @@ package com.nisum.offertransactionservice.service;
import com.nisum.offertransactionservice.client.PromotionEngineFeignClient;
import com.nisum.offertransactionservice.client.StoreProducerFeignClient;
import com.nisum.offertransactionservice.converter.OfferConvertion;
import com.nisum.offertransactionservice.dao.OfferLookupRepo;
import com.nisum.offertransactionservice.dao.OfferMetaDataRepo;
import com.nisum.offertransactionservice.dto.*;
import com.nisum.offertransactionservice.genericexception.CustomCreatedCustomException;
import com.nisum.offertransactionservice.genericexception.GlobalApiGenericException;
import com.nisum.offertransactionservice.model.*;
import feign.FeignException;
import lombok.extern.slf4j.Slf4j;
import org.mapstruct.factory.Mappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment