Commit 272e4913 authored by Kali Padhi's avatar Kali Padhi

Modified Test Cases and CHanges logic as per database column change

parent 46315e2b
......@@ -27,32 +27,32 @@ Go to Add New Server --> Give any database name --> go to connection tab and pro
```bash
Host = 127.0.0.1
Port = 5432
username = user
password = password123
username = postgres
password = welcome123
```
Then click on save
In Header click on Tool -> Query Tool --> and paste the below query
```bash
-- Table: public.offerlookup
-- Table: public.offer_lookup
-- DROP TABLE public.offerlookup;
-- DROP TABLE public.offer_lookup;
CREATE TABLE public.offerlookup
CREATE TABLE public.offer_lookup
(
offer_lookup_id text COLLATE pg_catalog."default" NOT NULL,
id INTEGER, COLLATE pg_catalog."default" NOT NULL,
store_id text COLLATE pg_catalog."default" NOT NULL,
terminal text COLLATE pg_catalog."default" NOT NULL,
offer_type text COLLATE pg_catalog."default" NOT NULL,
offer_id text COLLATE pg_catalog."default" NOT NULL,
pre_condition text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT "OfferLookup_pkey" PRIMARY KEY (offer_lookup_id)
CONSTRAINT "OfferLookup_pkey" PRIMARY KEY (id, offer_type,offer_id)
)
TABLESPACE pg_default;
ALTER TABLE public.offerlookup
ALTER TABLE public.offer_lookup
OWNER to "postgress";
```
......@@ -60,18 +60,18 @@ ALTER TABLE public.offerlookup
```bash
Once you create use the below query to insert a data
INSERT INTO public.offerlookup(
store_id, terminal, offer_type, offer_id, pre_condition,offer_lookup_id)
VALUES ('0001','001','Customer','o1','AND','54321');
INSERT INTO public.offerlookup(
store_id, terminal, offer_type, offer_id, pre_condition,offer_lookup_id)
VALUES ('0001','001','Customer','o2','AND','54321');
INSERT INTO public.offerlookup(
store_id, terminal, offer_type, offer_id, pre_condition,offer_lookup_id)
VALUES ('0001','001','Customer','o3','AND','54321');
INSERT INTO public.offerlookup(
store_id, terminal, offer_type, offer_id, pre_condition,offer_lookup_id)
VALUES ('0001','001','Customer','o4','AND','54321');
INSERT INTO public.offer_lookup(
store_id, terminal, offer_type, offer_id, pre_condition, id)
VALUES ('0001','001','Customer',1,'AND',54321);
INSERT INTO public.offer_lookup(
store_id, terminal, offer_type, offer_id, pre_condition,id)
VALUES ('0001','001','Customer',2,'AND',54321);
INSERT INTO public.offer_lookup(
store_id, terminal, offer_type, offer_id, pre_condition,id)
VALUES ('0001','001','Customer',3,'AND',54321);
INSERT INTO public.offer_lookup(
store_id, terminal, offer_type, offer_id, pre_condition,id)
VALUES ('0001','001','Customer',4,'AND',54321);
```
......@@ -111,7 +111,7 @@ INSERT INTO endofsale VALUES ( uuid_generate_v4() ,
CREATE TABLE public.offer_meta_data
(
offerid text COLLATE pg_catalog."default" NOT NULL,
offer_id INTEGER COLLATE pg_catalog."default" NOT NULL,
eligibility text COLLATE pg_catalog."default" NOT NULL,
discount_type text COLLATE pg_catalog."default" NOT NULL,
status text COLLATE pg_catalog."default" NOT NULL,
......@@ -119,8 +119,8 @@ CREATE TABLE public.offer_meta_data
end_time timestamp with time zone NOT NULL,
offer_desc text COLLATE pg_catalog."default" NOT NULL,
offer_type text COLLATE pg_catalog."default" NOT NULL,
rcpt_txt text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT offer_meta_data_pkey PRIMARY KEY (offerid)
rcpt_text text COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT offer_meta_data_pkey PRIMARY KEY (offer_id)
)
TABLESPACE pg_default;
......@@ -141,28 +141,27 @@ dummy data
==========
INSERT INTO public.offer_meta_data(
offerid, eligibility, discount_type, offer_meta_status, start_time,end_time,
offer_desc,offer_type,rcpt_txt)
VALUES ('o1','elgibility','dicounted','Active','2020-04-14 19:10:25','2020-04-15 19:10:25',
offer_id, eligibility, discount_type, status, start_time,end_time,
offer_desc,offer_type,rcpt_text)
VALUES (1,'elgibility','dicounted','Active','2020-04-14 19:10:25','2020-04-15 19:10:25',
'30 percent','5','RCPT TXT');
INSERT INTO public.offer_meta_data(
offerid, eligibility, discount_type, offer_meta_status, start_time,end_time,
offer_desc,offer_type,rcpt_txt)
VALUES ('o2','elgibility','dicounted','InActive','2020-04-14 19:10:25','2020-04-15 19:10:25',
offer_id, eligibility, discount_type, status, start_time,end_time,
offer_desc,offer_type,rcpt_text)
VALUES (2,'elgibility','dicounted','InActive','2020-04-14 19:10:25','2020-04-15 19:10:25',
'20 percent','5','RCPT TXT');
INSERT INTO public.offer_meta_data(
offerid, eligibility, discount_type, offer_meta_status, start_time,end_time,
offer_desc,offer_type,rcpt_txt)
VALUES ('o3','elgibility','dicounted','Active','2020-04-15 19:10:25','2020-04-16 19:10:25',
offer_id, eligibility, discount_type, status, start_time,end_time,
offer_desc,offer_type,rcpt_text)
VALUES (3,'elgibility','dicounted','Active','2020-04-15 19:10:25','2020-04-16 19:10:25',
'10 percent','5','RCPT TXT');
INSERT INTO public.offer_meta_data(
offerid, eligibility, discount_type, offer_meta_status, start_time,end_time,
offer_desc,offer_type,rcpt_txt)
VALUES ('o4','elgibility','dicounted','Active','2020-04-1 19:10:25','2020-04-15 19:10:25',
offer_id, eligibility, discount_type, status, start_time,end_time,
offer_desc,offer_type,rcpt_text)
VALUES (4,'elgibility','dicounted','Active','2020-04-1 19:10:25','2020-04-15 19:10:25',
'05 percent','5','RCPT TXT');
```
package com.nisum.offertransactionservice.config;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldDefaults;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@Data
@ConfigurationProperties(prefix = "endpoint.url")
public class OfferTransactionConfig {
......@@ -17,35 +23,4 @@ public class OfferTransactionConfig {
private String peBaseUrl;
public String getStoreProducerUrl() {
return storeProducerUrl;
}
public void setStoreProducerUrl(String storeProducerUrl) {
this.storeProducerUrl = storeProducerUrl;
}
public String getSpBaseUrl() {
return spBaseUrl;
}
public void setSpBaseUrl(String spBaseUrl) {
this.spBaseUrl = spBaseUrl;
}
public String getPromotionEngineUrl() {
return promotionEngineUrl;
}
public void setPromotionEngineUrl(String promotionEngineUrl) {
this.promotionEngineUrl = promotionEngineUrl;
}
public String getPeBaseUrl() {
return peBaseUrl;
}
public void setPeBaseUrl(String peBaseUrl) {
this.peBaseUrl = peBaseUrl;
}
}
\ No newline at end of file
......@@ -28,9 +28,8 @@ public class OfferTransactionController {
@PostMapping("offerTransactionCall")
public OfferTransactionResponse getOfferTransactionResponse(@Valid @RequestBody OfferTransactionRequest offerTransactionRequest) throws InterruptedException {
Thread.sleep(1000);
MDC.put("swy-res-unique-uuid", offerTransactionRequest.getHhId());
MDC.put("user-id", offerTransactionRequest.getHhId());
MDC.put("swy-res-unique-uuid", String.valueOf(offerTransactionRequest.getHhId()));
MDC.put("user-id", String.valueOf(offerTransactionRequest.getHhId()));
return offerCallingPEService.getDiscountedItemList(offerTransactionRequest);
}
......
package com.nisum.offertransactionservice.dao;
import com.nisum.offertransactionservice.dto.Offer;
import com.nisum.offertransactionservice.model.OfferLookup;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
public interface OfferLookupRepo extends CrudRepository<OfferLookup,Long> {
import javax.swing.text.html.Option;
import java.util.List;
import java.util.Optional;
public interface OfferLookupRepo extends JpaRepository<OfferLookup,Long> {
@Query(value= "SELECT * FROM offer_lookup WHERE id=:hhid" , nativeQuery = true)
public List<OfferLookup> findByHhId(Long hhid);
}
......@@ -18,9 +18,9 @@ import javax.persistence.EmbeddedId;
public class OfferLookupDTO {
String id;
Long id;
String idType;
String offerId;
Long offerId;
String storeId;
String terminal;
String preCondition;
......
......@@ -15,7 +15,7 @@ import java.time.LocalDateTime;
public class OfferMetaDTO {
String offerId;
Long offerId;
LocalDateTime startTime;
......
......@@ -21,7 +21,7 @@ import static com.google.common.collect.Lists.newArrayList;
public class OfferTransactionRequest {
@NotNull
String hhId;
Long hhId;
String transactionId= UUID.randomUUID().toString();
......
......@@ -19,7 +19,7 @@ import static com.google.common.collect.Lists.newArrayList;
@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = false)
public class PERequest {
String hhId;
Long hhId;
List<Item> itemList;
List<OfferLookupDTO> eligibleOffers;
}
......@@ -17,6 +17,6 @@ import static com.google.common.collect.Lists.newArrayList;
@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = false)
public class PEResponse {
String hhid;
Long hhid;
List<Item> discountedItemList = newArrayList();
}
......@@ -18,13 +18,13 @@ import java.io.Serializable;
public class OfferLookupComposite implements Serializable {
@Column(name = "offer_lookup_id")
String id;
@Column(name = "id")
Long id;
@Column(name ="offer_type")
String idType;
@Column(name ="offer_id")
String offerId;
Long offerId;
}
......@@ -31,7 +31,7 @@ public class OfferMeta {
@Column(name="end_time")
LocalDateTime expiryTime;
@Column(name="offer_meta_status")
@Column(name="status")
String offerStatus;
@Column(name="eligibility")
......@@ -46,6 +46,6 @@ public class OfferMeta {
@Column(name="offer_desc")
String offerDesc;
@Column(name="rcpt_txt")
@Column(name="rcpt_text")
String rcptTxt;
}
......@@ -37,7 +37,7 @@ public class OfferCallingPEService {
public OfferTransactionResponse getDiscountedItemList(OfferTransactionRequest offerTransactionRequest) {
log.info("Inside getDiscountedItemList Method");
List<OfferLookup> eligibleOffer = new ArrayList();
offerLookupRepo.findAll().forEach(eligibleOffer::add);
offerLookupRepo.findByHhId(offerTransactionRequest.getHhId()).forEach(eligibleOffer::add);
List<OfferLookupDTO> offerLookupDTOList = getOfferMetaDto(eligibleOffer);
if (offerLookupDTOList.isEmpty()) {
log.error("Offer lookup Object is empty");
......
......@@ -67,7 +67,7 @@ public class ClientServiceTest {
public void getStringMonoTest(){
String uuid = "86fd4146-0540-405b-b621-a95f4ccdfa0d";
//when(offerTransactionConfig.getPeBaseUrl()).thenReturn("http://localhost:8089");
when(offerTransactionConfig.getSpBaseUrl()).thenReturn("http://localhost:8081");
//when(offerTransactionConfig.getSpBaseUrl()).thenReturn("http://localhost:8081");
when(webClientMock.post()).thenReturn(requestBodyUriMock);
when(requestBodyUriMock.uri("/store/producer")).thenReturn(requestBodyMock);
when(requestBodyMock.bodyValue(Mono.just(uuid))).thenReturn(requestHeadersMock);
......@@ -80,7 +80,7 @@ public class ClientServiceTest {
private PERequest getPEReq() {
PERequest peRequest = new PERequest();
peRequest.setHhId("123");
peRequest.setHhId(123L);
List<Item> itemList = new ArrayList<>();
Item item1 = new Item("Coke", "12", 13.05);
Item item2 = new Item("Thumpsup", "11", 14.05);
......@@ -92,7 +92,7 @@ public class ClientServiceTest {
private PEResponse getPeResponse() {
PEResponse peResponse = new PEResponse();
peResponse.setHhid("123");
peResponse.setHhid(123L);
List<Item> itemList = new ArrayList<>();
Item item1 = new Item("Coke", "12", 6.05);
Item item2 = new Item("Thumpsup", "11", 12.32);
......
......@@ -97,7 +97,7 @@ public class OfferControllerTest {
private OfferTransactionRequest getOfferTransactionRequest() {
OfferTransactionRequest offerTransactionRequest = new OfferTransactionRequest();
offerTransactionRequest.setHhId("123");
offerTransactionRequest.setHhId(123L);
List<Item> itemList = new ArrayList<>();
Item item1 = new Item("Coke", "12", 13.05);
Item item2 = new Item("Thumpsup", "11", 14.05);
......
......@@ -8,24 +8,20 @@ import com.nisum.offertransactionservice.dto.*;
import com.nisum.offertransactionservice.model.EndOfSaleEntity;
import com.nisum.offertransactionservice.model.OfferLookup;
import com.nisum.offertransactionservice.model.OfferMeta;
import com.nisum.offertransactionservice.service.OfferCallingPEService;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Description;
import reactor.core.publisher.Mono;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.time.LocalDateTime;
import java.util.*;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.*;
@SpringBootTest
class OfferTransactionControllerTest {
......@@ -52,12 +48,17 @@ class OfferTransactionControllerTest {
private String UU_ID_FOR_END_OF_TRANSACTION = "id01";
@Mock
private OfferCallingPEService offerCallingPEService;
@Description("Component test for getOfferTransactionResponse method")
@Test
void getOfferTransactionResponse() throws InterruptedException {
when(offerLookupRepo.findAll()).thenReturn(getOffers());
when(offerLookupRepo.findByHhId(ArgumentMatchers.any())).thenReturn(getOffers());
when(clientService.getPeResponseFlux(Mockito.any(PERequest.class))).thenReturn(getPeResponse());
when(offerMetaDataRepo.findByOfferIdAndOfferStatus(Mockito.anyLong(), Mockito.anyString())).thenReturn(Optional.of(new OfferMeta()));
when(offerCallingPEService.getOfferMetaDto(ArgumentMatchers.any())).thenReturn(getOfferLookupDto());
Mockito.doReturn(Optional.of(getOfferMeta())).when(offerMetaDataRepo).findByOfferIdAndOfferStatus(Mockito.anyLong(), Mockito.anyString());
OfferTransactionResponse offerTransactionResponse = offerTransactionController.getOfferTransactionResponse(getOfferTransactionRequest());
assertEquals(Objects.nonNull(offerTransactionResponse.getTransactionId()),true);
}
......@@ -65,9 +66,9 @@ class OfferTransactionControllerTest {
@Description("Component test for endOfSale method")
@Test
void endOfSale() throws IOException {
doNothing().when(endOfSaleRepo.save(Mockito.any(EndOfSaleEntity.class)));
when(endOfSaleRepo.save(Mockito.any(EndOfSaleEntity.class))).thenReturn(new EndOfSaleEntity());
assertEquals(Objects.nonNull(offerTransactionController.endOfSale(buildEndOfSaleReq())),true);
}
}
@Description("Component test for endOfTransaction method")
@Test
......@@ -78,8 +79,8 @@ class OfferTransactionControllerTest {
private List<OfferLookup> getOffers() {
OfferLookup offerLookup1 = new OfferLookup(1L, "12", 234L, "02", "AND", "BOGO");
OfferLookup offerLookup2 = new OfferLookup(2l, "13", 234L, "02", "OR", "BXGY");
List<OfferLookup> offerLookups = new ArrayList<>();
OfferLookup offerLookup2 = new OfferLookup(2L, "13", 234L, "02", "OR", "BXGY");
List<OfferLookup> offerLookups = new ArrayList<>();
offerLookups.add(offerLookup1);
offerLookups.add(offerLookup2);
return offerLookups;
......@@ -87,14 +88,14 @@ class OfferTransactionControllerTest {
private OfferTransactionRequest getOfferTransactionRequest() {
OfferTransactionRequest offerTransactionRequest = new OfferTransactionRequest();
offerTransactionRequest.setHhId("123");
offerTransactionRequest.setHhId(54321L);
offerTransactionRequest.setItemList(getItemList());
return offerTransactionRequest;
}
private PEResponse getPeResponse() {
PEResponse peResponse = new PEResponse();
peResponse.setHhid("123");
peResponse.setHhid(123L);
peResponse.setDiscountedItemList(getItemList());
return peResponse;
}
......@@ -116,4 +117,71 @@ class OfferTransactionControllerTest {
private Mono<String> getMonoOfString() {
return Mono.just("MONO_TO_STRING");
}
private OfferMeta getOfferMeta(){
OfferMeta offerMetaDTO = new OfferMeta();
offerMetaDTO.setDiscount("discount");
offerMetaDTO.setEligibility("eligibility");
offerMetaDTO.setExpiryTime(LocalDateTime.of(2021,01,01,01,01));
offerMetaDTO.setStartTime(LocalDateTime.of(2020,01,01,01,01));
offerMetaDTO.setOfferDesc("30 percent");
offerMetaDTO.setOfferId(1L);
offerMetaDTO.setOfferStatus("Active");
offerMetaDTO.setRcptTxt("text");
offerMetaDTO.setOfferType("aaa");
return offerMetaDTO;
}
private List<OfferLookupDTO> getOfferLookupDto(){
OfferLookupDTO offerLookupDTO = new OfferLookupDTO();
offerLookupDTO.setId(123456L);
offerLookupDTO.setIdType("1234");
offerLookupDTO.setOfferId(1L);
offerLookupDTO.setPreCondition("And");
offerLookupDTO.setStoreId("001");
offerLookupDTO.setTerminal("001");
OfferMetaDTO offerMetaDTO = new OfferMetaDTO();
offerMetaDTO.setDiscount("discount");
offerMetaDTO.setEligibility("eligibility");
offerMetaDTO.setExpiryTime(LocalDateTime.of(2021,01,01,01,01));
offerMetaDTO.setStartTime(LocalDateTime.of(2020,01,01,01,01));
offerMetaDTO.setOfferDesc("30 percent");
offerMetaDTO.setOfferId(1L);
offerMetaDTO.setOfferStatus("Active");
offerMetaDTO.setRcptTxt("text");
offerMetaDTO.setOfferType("aaa");
offerLookupDTO.setOfferMetaDTO(offerMetaDTO);
OfferLookupDTO offerLookupDTO1 = new OfferLookupDTO();
offerLookupDTO1.setId(123456L);
offerLookupDTO1.setIdType("1234");
offerLookupDTO1.setOfferId(1L);
offerLookupDTO1.setPreCondition("And");
offerLookupDTO1.setStoreId("001");
offerLookupDTO1.setTerminal("001");
OfferMetaDTO offerMetaDTO1 = new OfferMetaDTO();
offerMetaDTO1.setDiscount("discount");
offerMetaDTO1.setEligibility("eligibility");
offerMetaDTO1.setExpiryTime(LocalDateTime.of(2021,01,01,01,01));
offerMetaDTO1.setStartTime(LocalDateTime.of(2020,01,01,01,01));
offerMetaDTO1.setOfferDesc("20 percent");
offerMetaDTO1.setOfferId(1L);
offerMetaDTO1.setOfferStatus("Active");
offerMetaDTO1.setRcptTxt("text");
offerMetaDTO1.setOfferType("aaa");
offerLookupDTO1.setOfferMetaDTO(offerMetaDTO);
List<OfferLookupDTO> offerLookupDTOList = Arrays.asList(offerLookupDTO1, offerLookupDTO);
return offerLookupDTOList;
}
}
\ No newline at end of file
......@@ -14,7 +14,6 @@ import org.springframework.test.web.reactive.server.WebTestClient;
import reactor.core.publisher.Mono;
@RunWith(MockitoJUnitRunner.class)
@Ignore
public class EndOfTransactionTest {
@Mock
......
......@@ -27,7 +27,6 @@ import java.util.stream.Collectors;
@RunWith(MockitoJUnitRunner.class)
@SpringBootTest
@DirtiesContext
public class OfferServiceTest {
@Mock
private OfferLookupRepo offerLookupRepo;
......@@ -50,7 +49,7 @@ public class OfferServiceTest {
@Test
public void serviceTest() {
OfferTransactionRequest offerTransactionRequest = getOfferTransactionRequest();
Mockito.when(offerLookupRepo.findAll()).thenReturn(returnOffers());
Mockito.when(offerLookupRepo.findByHhId(ArgumentMatchers.any())).thenReturn(returnOffers());
Mockito.when(clientService.getPeResponseFlux(ArgumentMatchers.any())).thenReturn(getPeResponse());
Mockito.doReturn(getOfferMeta()).when(offerMetaDataRepo).findByOfferIdAndOfferStatus(ArgumentMatchers.any(),ArgumentMatchers.any());
OfferTransactionResponse offerTransactionResponse = offerCallingPEService.getDiscountedItemList(offerTransactionRequest);
......@@ -60,7 +59,7 @@ public class OfferServiceTest {
@Test(expected = GlobalApiGenericException.class)
public void serviceNegTest() {
OfferTransactionRequest offerTransactionRequest = getOfferTransactionRequest();
Mockito.when(offerLookupRepo.findAll()).thenReturn(returnOffers());
Mockito.when(offerLookupRepo.findByHhId(ArgumentMatchers.any())).thenReturn(returnOffers());
Mockito.doReturn(Optional.empty()).when(offerMetaDataRepo).findByOfferIdAndOfferStatus(ArgumentMatchers.any(),ArgumentMatchers.any());
offerCallingPEService.getDiscountedItemList(offerTransactionRequest);
}
......@@ -80,7 +79,7 @@ public class OfferServiceTest {
private PEResponse getPeResponse() {
PEResponse peResponse = new PEResponse();
peResponse.setHhid("123");
peResponse.setHhid(123L);
List<Item> itemList = new ArrayList<>();
Item item1 = new Item("Coke", "12", 6.05);
Item item2 = new Item("Thumpsup", "11", 12.32);
......@@ -92,7 +91,7 @@ public class OfferServiceTest {
private PERequest getPEReq() {
PERequest peRequest = new PERequest();
peRequest.setHhId("123");
peRequest.setHhId(123L);
List<Item> itemList = new ArrayList<>();
Item item1 = new Item("Coke", "12", 6.05);
Item item2 = new Item("Thumpsup", "11", 12.32);
......@@ -104,7 +103,7 @@ public class OfferServiceTest {
private OfferTransactionRequest getOfferTransactionRequest() {
OfferTransactionRequest offerTransactionRequest = new OfferTransactionRequest();
offerTransactionRequest.setHhId("123");
offerTransactionRequest.setHhId(123L);
List<Item> itemList = new ArrayList<>();
Item item1 = new Item("Coke", "12", 6.05);
Item item2 = new Item("Thumpsup", "11", 12.32);
......@@ -114,7 +113,7 @@ public class OfferServiceTest {
return offerTransactionRequest;
}
public Iterable<OfferLookup> returnOffers() {
public List<OfferLookup> returnOffers() {
OfferLookup offerLookup1 = new OfferLookup(1L, "12", 20L, "02", "AND", "BOGO");
OfferLookup offerLookup2 = new OfferLookup(2L, "13", 23L, "02", "OR", "BXGY");
List<OfferLookup> offerLookups = new ArrayList<>();
......@@ -142,9 +141,9 @@ public class OfferServiceTest {
private List<OfferLookupDTO> getOfferLookupDto(){
OfferLookupDTO offerLookupDTO = new OfferLookupDTO();
offerLookupDTO.setId("123456");
offerLookupDTO.setId(123456L);
offerLookupDTO.setIdType("1234");
offerLookupDTO.setOfferId("o1");
offerLookupDTO.setOfferId(1L);
offerLookupDTO.setPreCondition("And");
offerLookupDTO.setStoreId("001");
offerLookupDTO.setTerminal("001");
......@@ -155,7 +154,7 @@ public class OfferServiceTest {
offerMetaDTO.setExpiryTime(LocalDateTime.of(2021,01,01,01,01));
offerMetaDTO.setStartTime(LocalDateTime.of(2020,01,01,01,01));
offerMetaDTO.setOfferDesc("30 percent");
offerMetaDTO.setOfferId("o1");
offerMetaDTO.setOfferId(1L);
offerMetaDTO.setOfferStatus("Active");
offerMetaDTO.setRcptTxt("text");
offerMetaDTO.setOfferType("aaa");
......@@ -164,9 +163,9 @@ public class OfferServiceTest {
OfferLookupDTO offerLookupDTO1 = new OfferLookupDTO();
offerLookupDTO1.setId("123456");
offerLookupDTO1.setId(123456L);
offerLookupDTO1.setIdType("1234");
offerLookupDTO1.setOfferId("o1");
offerLookupDTO1.setOfferId(1L);
offerLookupDTO1.setPreCondition("And");
offerLookupDTO1.setStoreId("001");
offerLookupDTO1.setTerminal("001");
......@@ -177,7 +176,7 @@ public class OfferServiceTest {
offerMetaDTO1.setExpiryTime(LocalDateTime.of(2021,01,01,01,01));
offerMetaDTO1.setStartTime(LocalDateTime.of(2020,01,01,01,01));
offerMetaDTO1.setOfferDesc("20 percent");
offerMetaDTO1.setOfferId("o1");
offerMetaDTO1.setOfferId(1L);
offerMetaDTO1.setOfferStatus("Active");
offerMetaDTO1.setRcptTxt("text");
offerMetaDTO1.setOfferType("aaa");
......
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