Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OTSWithFeign
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bhaskar Katakam
OTSWithFeign
Commits
78aa6eb8
Commit
78aa6eb8
authored
Apr 20, 2020
by
Kali Padhi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.mynisum.com/sgandhi/offertransactionservice
parents
a6e32025
ffb13128
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
33 additions
and
22 deletions
+33
-22
readme.md
readme.md
+5
-5
OfferLookupRepo.java
...om/nisum/offertransactionservice/dao/OfferLookupRepo.java
+2
-2
OfferLookupDTO.java
...com/nisum/offertransactionservice/dto/OfferLookupDTO.java
+1
-1
OfferTransactionRequest.java
.../offertransactionservice/dto/OfferTransactionRequest.java
+1
-1
OfferLookup.java
.../com/nisum/offertransactionservice/model/OfferLookup.java
+1
-1
OfferLookupComposite.java
...m/offertransactionservice/model/OfferLookupComposite.java
+1
-1
application.properties
src/main/resources/application.properties
+1
-0
OfferTransactionControllerIntegrationTest.java
...controller/OfferTransactionControllerIntegrationTest.java
+2
-0
OfferTransactionControllerTest.java
...ionservice/controller/OfferTransactionControllerTest.java
+4
-4
EndOfSaleTest.java
.../nisum/offertransactionservice/service/EndOfSaleTest.java
+2
-2
OfferServiceTest.java
...sum/offertransactionservice/service/OfferServiceTest.java
+5
-5
application-integration.properties
src/test/resources/application-integration.properties
+8
-0
No files found.
readme.md
View file @
78aa6eb8
...
@@ -40,7 +40,7 @@ In Header click on Tool -> Query Tool --> and paste the below query
...
@@ -40,7 +40,7 @@ In Header click on Tool -> Query Tool --> and paste the below query
CREATE TABLE offer_lookup
CREATE TABLE offer_lookup
(
(
id
INTEGER
,
id
VARCHAR
(
500
)
,
store_id VARCHAR
(
200
)
,
store_id VARCHAR
(
200
)
,
terminal VARCHAR
(
200
)
,
terminal VARCHAR
(
200
)
,
offer_type VARCHAR
(
200
)
,
offer_type VARCHAR
(
200
)
,
...
@@ -61,16 +61,16 @@ Once you create use the below query to insert a data
...
@@ -61,16 +61,16 @@ Once you create use the below query to insert a data
INSERT INTO public.offer_lookup
(
INSERT INTO public.offer_lookup
(
store_id, terminal, offer_type, offer_id, pre_condition,
id
)
store_id, terminal, offer_type, offer_id, pre_condition,
id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,1,
'AND'
,
54321
)
;
VALUES
(
'0001'
,
'001'
,
'Customer'
,1,
'AND'
,
"54321"
)
;
INSERT INTO public.offer_lookup
(
INSERT INTO public.offer_lookup
(
store_id, terminal, offer_type, offer_id, pre_condition,id
)
store_id, terminal, offer_type, offer_id, pre_condition,id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,2,
'AND'
,
54321
)
;
VALUES
(
'0001'
,
'001'
,
'Customer'
,2,
'AND'
,
"54321"
)
;
INSERT INTO public.offer_lookup
(
INSERT INTO public.offer_lookup
(
store_id, terminal, offer_type, offer_id, pre_condition,id
)
store_id, terminal, offer_type, offer_id, pre_condition,id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,3,
'AND'
,
54321
)
;
VALUES
(
'0001'
,
'001'
,
'Customer'
,3,
'AND'
,
"54321"
)
;
INSERT INTO public.offer_lookup
(
INSERT INTO public.offer_lookup
(
store_id, terminal, offer_type, offer_id, pre_condition,id
)
store_id, terminal, offer_type, offer_id, pre_condition,id
)
VALUES
(
'0001'
,
'001'
,
'Customer'
,4,
'AND'
,
54321
)
;
VALUES
(
'0001'
,
'001'
,
'Customer'
,4,
'AND'
,
"54321"
)
;
```
```
...
...
src/main/java/com/nisum/offertransactionservice/dao/OfferLookupRepo.java
View file @
78aa6eb8
...
@@ -10,10 +10,10 @@ import javax.swing.text.html.Option;
...
@@ -10,10 +10,10 @@ import javax.swing.text.html.Option;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
public
interface
OfferLookupRepo
extends
JpaRepository
<
OfferLookup
,
Lo
ng
>
{
public
interface
OfferLookupRepo
extends
JpaRepository
<
OfferLookup
,
Stri
ng
>
{
@Query
(
value
=
"SELECT * FROM offer_lookup WHERE id=:hhid"
,
nativeQuery
=
true
)
@Query
(
value
=
"SELECT * FROM offer_lookup WHERE id=:hhid"
,
nativeQuery
=
true
)
public
List
<
OfferLookup
>
findByHhId
(
Lo
ng
hhid
);
public
List
<
OfferLookup
>
findByHhId
(
Stri
ng
hhid
);
...
...
src/main/java/com/nisum/offertransactionservice/dto/OfferLookupDTO.java
View file @
78aa6eb8
...
@@ -18,7 +18,7 @@ import javax.persistence.EmbeddedId;
...
@@ -18,7 +18,7 @@ import javax.persistence.EmbeddedId;
public
class
OfferLookupDTO
{
public
class
OfferLookupDTO
{
Lo
ng
id
;
Stri
ng
id
;
String
idType
;
String
idType
;
Long
offerId
;
Long
offerId
;
String
storeId
;
String
storeId
;
...
...
src/main/java/com/nisum/offertransactionservice/dto/OfferTransactionRequest.java
View file @
78aa6eb8
...
@@ -21,7 +21,7 @@ import static com.google.common.collect.Lists.newArrayList;
...
@@ -21,7 +21,7 @@ import static com.google.common.collect.Lists.newArrayList;
public
class
OfferTransactionRequest
{
public
class
OfferTransactionRequest
{
@NotNull
@NotNull
Lo
ng
hhId
;
Stri
ng
hhId
;
String
transactionId
=
UUID
.
randomUUID
().
toString
();
String
transactionId
=
UUID
.
randomUUID
().
toString
();
...
...
src/main/java/com/nisum/offertransactionservice/model/OfferLookup.java
View file @
78aa6eb8
...
@@ -19,7 +19,7 @@ public class OfferLookup {
...
@@ -19,7 +19,7 @@ public class OfferLookup {
@Id
@Id
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
Lo
ng
id
;
Stri
ng
id
;
@Id
@Id
@Column
(
name
=
"offer_type"
)
@Column
(
name
=
"offer_type"
)
...
...
src/main/java/com/nisum/offertransactionservice/model/OfferLookupComposite.java
View file @
78aa6eb8
...
@@ -19,7 +19,7 @@ public class OfferLookupComposite implements Serializable {
...
@@ -19,7 +19,7 @@ public class OfferLookupComposite implements Serializable {
@Column
(
name
=
"id"
)
@Column
(
name
=
"id"
)
Lo
ng
id
;
Stri
ng
id
;
@Column
(
name
=
"offer_type"
)
@Column
(
name
=
"offer_type"
)
String
idType
;
String
idType
;
...
...
src/main/resources/application.properties
View file @
78aa6eb8
spring.profiles.active
=
dev
spring.datasource.url
=
jdbc:postgresql://127.0.0.1:5432/storedb
spring.datasource.url
=
jdbc:postgresql://127.0.0.1:5432/storedb
spring.datasource.username
=
postgres
spring.datasource.username
=
postgres
spring.datasource.password
=
dbpwd
spring.datasource.password
=
dbpwd
...
...
src/test/java/com/nisum/offertransactionservice/controller/OfferTransactionControllerIntegrationTest.java
View file @
78aa6eb8
...
@@ -15,6 +15,7 @@ import org.springframework.core.ParameterizedTypeReference;
...
@@ -15,6 +15,7 @@ import org.springframework.core.ParameterizedTypeReference;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.test.context.ActiveProfiles
;
import
java.net.URI
;
import
java.net.URI
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -26,6 +27,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.*;
...
@@ -26,6 +27,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.*;
@SpringBootTest
(
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
DEFINED_PORT
)
@SpringBootTest
(
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
DEFINED_PORT
)
@AutoConfigureWireMock
@AutoConfigureWireMock
@ActiveProfiles
(
value
=
"integration"
)
public
class
OfferTransactionControllerIntegrationTest
extends
AbstractTestBase
{
public
class
OfferTransactionControllerIntegrationTest
extends
AbstractTestBase
{
@Rule
@Rule
...
...
src/test/java/com/nisum/offertransactionservice/controller/OfferTransactionControllerTest.java
View file @
78aa6eb8
...
@@ -83,8 +83,8 @@ class OfferTransactionControllerTest {
...
@@ -83,8 +83,8 @@ class OfferTransactionControllerTest {
}
}
private
List
<
OfferLookup
>
getOffers
()
{
private
List
<
OfferLookup
>
getOffers
()
{
OfferLookup
offerLookup1
=
new
OfferLookup
(
1L
,
"12"
,
234L
,
"02"
,
"AND"
,
"BOGO"
);
OfferLookup
offerLookup1
=
new
OfferLookup
(
"123"
,
"12"
,
234L
,
"02"
,
"AND"
,
"BOGO"
);
OfferLookup
offerLookup2
=
new
OfferLookup
(
2L
,
"13"
,
234L
,
"02"
,
"OR"
,
"BXGY"
);
OfferLookup
offerLookup2
=
new
OfferLookup
(
"1213"
,
"13"
,
234L
,
"02"
,
"OR"
,
"BXGY"
);
List
<
OfferLookup
>
offerLookups
=
new
ArrayList
<>();
List
<
OfferLookup
>
offerLookups
=
new
ArrayList
<>();
offerLookups
.
add
(
offerLookup1
);
offerLookups
.
add
(
offerLookup1
);
offerLookups
.
add
(
offerLookup2
);
offerLookups
.
add
(
offerLookup2
);
...
@@ -141,7 +141,7 @@ class OfferTransactionControllerTest {
...
@@ -141,7 +141,7 @@ class OfferTransactionControllerTest {
private
List
<
OfferLookupDTO
>
getOfferLookupDto
(){
private
List
<
OfferLookupDTO
>
getOfferLookupDto
(){
OfferLookupDTO
offerLookupDTO
=
new
OfferLookupDTO
();
OfferLookupDTO
offerLookupDTO
=
new
OfferLookupDTO
();
offerLookupDTO
.
setId
(
123456L
);
offerLookupDTO
.
setId
(
"123"
);
offerLookupDTO
.
setIdType
(
"1234"
);
offerLookupDTO
.
setIdType
(
"1234"
);
offerLookupDTO
.
setOfferId
(
1L
);
offerLookupDTO
.
setOfferId
(
1L
);
offerLookupDTO
.
setPreCondition
(
"And"
);
offerLookupDTO
.
setPreCondition
(
"And"
);
...
@@ -163,7 +163,7 @@ class OfferTransactionControllerTest {
...
@@ -163,7 +163,7 @@ class OfferTransactionControllerTest {
OfferLookupDTO
offerLookupDTO1
=
new
OfferLookupDTO
();
OfferLookupDTO
offerLookupDTO1
=
new
OfferLookupDTO
();
offerLookupDTO1
.
setId
(
123456L
);
offerLookupDTO1
.
setId
(
"123"
);
offerLookupDTO1
.
setIdType
(
"1234"
);
offerLookupDTO1
.
setIdType
(
"1234"
);
offerLookupDTO1
.
setOfferId
(
1L
);
offerLookupDTO1
.
setOfferId
(
1L
);
offerLookupDTO1
.
setPreCondition
(
"And"
);
offerLookupDTO1
.
setPreCondition
(
"And"
);
...
...
src/test/java/com/nisum/offertransactionservice/service/EndOfSaleTest.java
View file @
78aa6eb8
...
@@ -93,8 +93,8 @@ public class EndOfSaleTest {
...
@@ -93,8 +93,8 @@ public class EndOfSaleTest {
}
}
public
List
<
OfferLookup
>
returnOffers
()
{
public
List
<
OfferLookup
>
returnOffers
()
{
OfferLookup
offerLookup1
=
new
OfferLookup
(
1L
,
"12"
,
23L
,
"02"
,
"AND"
,
"BOGO"
);
OfferLookup
offerLookup1
=
new
OfferLookup
(
"1"
,
"12"
,
23L
,
"02"
,
"AND"
,
"BOGO"
);
OfferLookup
offerLookup2
=
new
OfferLookup
(
2L
,
"13"
,
24L
,
"02"
,
"OR"
,
"BXGY"
);
OfferLookup
offerLookup2
=
new
OfferLookup
(
"2"
,
"13"
,
24L
,
"02"
,
"OR"
,
"BXGY"
);
List
<
OfferLookup
>
offerLookups
=
new
ArrayList
<>();
List
<
OfferLookup
>
offerLookups
=
new
ArrayList
<>();
offerLookups
.
add
(
offerLookup1
);
offerLookups
.
add
(
offerLookup1
);
offerLookups
.
add
(
offerLookup2
);
offerLookups
.
add
(
offerLookup2
);
...
...
src/test/java/com/nisum/offertransactionservice/service/OfferServiceTest.java
View file @
78aa6eb8
...
@@ -103,7 +103,7 @@ public class OfferServiceTest {
...
@@ -103,7 +103,7 @@ public class OfferServiceTest {
private
OfferTransactionRequest
getOfferTransactionRequest
()
{
private
OfferTransactionRequest
getOfferTransactionRequest
()
{
OfferTransactionRequest
offerTransactionRequest
=
new
OfferTransactionRequest
();
OfferTransactionRequest
offerTransactionRequest
=
new
OfferTransactionRequest
();
offerTransactionRequest
.
setHhId
(
123L
);
offerTransactionRequest
.
setHhId
(
"123"
);
List
<
Item
>
itemList
=
new
ArrayList
<>();
List
<
Item
>
itemList
=
new
ArrayList
<>();
Item
item1
=
new
Item
(
"Coke"
,
"12"
,
6.05
);
Item
item1
=
new
Item
(
"Coke"
,
"12"
,
6.05
);
Item
item2
=
new
Item
(
"Thumpsup"
,
"11"
,
12.32
);
Item
item2
=
new
Item
(
"Thumpsup"
,
"11"
,
12.32
);
...
@@ -114,8 +114,8 @@ public class OfferServiceTest {
...
@@ -114,8 +114,8 @@ public class OfferServiceTest {
}
}
public
List
<
OfferLookup
>
returnOffers
()
{
public
List
<
OfferLookup
>
returnOffers
()
{
OfferLookup
offerLookup1
=
new
OfferLookup
(
1L
,
"12"
,
20L
,
"02"
,
"AND"
,
"BOGO"
);
OfferLookup
offerLookup1
=
new
OfferLookup
(
"1"
,
"12"
,
20L
,
"02"
,
"AND"
,
"BOGO"
);
OfferLookup
offerLookup2
=
new
OfferLookup
(
2L
,
"13"
,
23L
,
"02"
,
"OR"
,
"BXGY"
);
OfferLookup
offerLookup2
=
new
OfferLookup
(
"2"
,
"13"
,
23L
,
"02"
,
"OR"
,
"BXGY"
);
List
<
OfferLookup
>
offerLookups
=
new
ArrayList
<>();
List
<
OfferLookup
>
offerLookups
=
new
ArrayList
<>();
offerLookups
.
add
(
offerLookup1
);
offerLookups
.
add
(
offerLookup1
);
offerLookups
.
add
(
offerLookup2
);
offerLookups
.
add
(
offerLookup2
);
...
@@ -141,7 +141,7 @@ public class OfferServiceTest {
...
@@ -141,7 +141,7 @@ public class OfferServiceTest {
private
List
<
OfferLookupDTO
>
getOfferLookupDto
(){
private
List
<
OfferLookupDTO
>
getOfferLookupDto
(){
OfferLookupDTO
offerLookupDTO
=
new
OfferLookupDTO
();
OfferLookupDTO
offerLookupDTO
=
new
OfferLookupDTO
();
offerLookupDTO
.
setId
(
123456L
);
offerLookupDTO
.
setId
(
"12345"
);
offerLookupDTO
.
setIdType
(
"1234"
);
offerLookupDTO
.
setIdType
(
"1234"
);
offerLookupDTO
.
setOfferId
(
1L
);
offerLookupDTO
.
setOfferId
(
1L
);
offerLookupDTO
.
setPreCondition
(
"And"
);
offerLookupDTO
.
setPreCondition
(
"And"
);
...
@@ -163,7 +163,7 @@ public class OfferServiceTest {
...
@@ -163,7 +163,7 @@ public class OfferServiceTest {
OfferLookupDTO
offerLookupDTO1
=
new
OfferLookupDTO
();
OfferLookupDTO
offerLookupDTO1
=
new
OfferLookupDTO
();
offerLookupDTO1
.
setId
(
123456L
);
offerLookupDTO1
.
setId
(
"12345"
);
offerLookupDTO1
.
setIdType
(
"1234"
);
offerLookupDTO1
.
setIdType
(
"1234"
);
offerLookupDTO1
.
setOfferId
(
1L
);
offerLookupDTO1
.
setOfferId
(
1L
);
offerLookupDTO1
.
setPreCondition
(
"And"
);
offerLookupDTO1
.
setPreCondition
(
"And"
);
...
...
src/test/resources/application-integration.properties
0 → 100644
View file @
78aa6eb8
spring.datasource.url
=
jdbc:postgresql://127.0.0.1:5432/postgres
spring.datasource.username
=
user
spring.datasource.password
=
password123
endpoint.url.promotionEngineUrl
=
/promotionEngine/calculateDiscount
endpoint.url.peBaseUrl
=
http://localhost:7073
endpoint.url.storeProducerUrl
=
/store/producer
endpoint.url.spBaseUrl
=
http://localhost:7070
server.port
=
7072
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment