Skip to content

Commit

Permalink
Adjusted tests to conform to new types.
Browse files Browse the repository at this point in the history
  • Loading branch information
KSGRelewise committed Aug 12, 2024
1 parent 92cf2c3 commit fab1c0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/src/test/java/com/relewise/client/GeneratedRequestsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public void testTrackOrderRequestWithBuilderPatternAndCreatorMethod() throws Exc

var orderRequest = TrackOrderRequest.create(
Order.create(
UserFactory.byTemporaryId("t-id"),
UserFactory.byTemporaryId("t-id").setChannel(Channel.create("Channel 1")),
Money.create(Currency.create("DKK"), 100.0),
"1"
).setChannel("Channel 1")
)
);

Executable action = () -> tracker.track(orderRequest);
Expand All @@ -36,7 +36,7 @@ public void testTrackOrderRequestWithBuilderPattern() throws Exception {

var orderRequest = (new TrackOrderRequest())
.setOrder((new Order())
.setUser(new User().setTemporaryId("t-Id"))
.setUser(new User().setTemporaryId("t-Id").setChannel(Channel.create("Channel 1")))
.setSubtotal((new Money())
.setAmount(100.0)
.setCurrency((new Currency())
Expand All @@ -45,7 +45,6 @@ public void testTrackOrderRequestWithBuilderPattern() throws Exception {
)
.setOrderNumber("1")
.setCartName("1")
.setChannel("Channel 1")
);

Executable action = () -> tracker.track(orderRequest);
Expand All @@ -62,14 +61,13 @@ public void testTrackOrderRequest() throws Exception {
var tracker = new Tracker(GetDatasetId(), GetApiKey(), "https://api.relewise.com");

var order = new Order(
UserFactory.byTemporaryId("t-ID"),
UserFactory.byTemporaryId("t-ID").setChannel(Channel.create("Channel 1")),
new Money(
new Currency("DKK"),
100.0
),
"1"
);
order.setChannel("Channel 1");

var orderRequest = new TrackOrderRequest(order);

Expand Down
7 changes: 7 additions & 0 deletions src/src/test/java/com/relewise/client/SearcherTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ public void testProductSearchWithRecentlyViewedFilter() throws Exception {
).setFilters(
FilterCollection.create(
ProductRecentlyViewedByUserFilter.create(OffsetDateTime.now().minusDays(365))
.setSettings(
FilterSettings.create()
.setScopes(
FilterScopes.create()
.setDefault(ApplyFilterSettings.create(true))
)
)
)
);

Expand Down

0 comments on commit fab1c0d

Please sign in to comment.