Skip to content

Commit ad2af3c

Browse files
fix test + address comments
1 parent dfb953f commit ad2af3c

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

srv/src/main/java/my/bookshop/handlers/AdminServiceHandler.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
import cds.gen.adminservice.BooksAddToOrderContext;
4848
import cds.gen.adminservice.BooksCovers;
4949
import cds.gen.adminservice.Books_;
50-
import cds.gen.adminservice.Info;
51-
import cds.gen.adminservice.Info_;
5250
import cds.gen.adminservice.OrderItems;
5351
import cds.gen.adminservice.OrderItems_;
5452
import cds.gen.adminservice.Orders;
@@ -70,13 +68,11 @@ class AdminServiceHandler implements EventHandler {
7068
private final PersistenceService db;
7169
private final Messages messages;
7270
private final CqnAnalyzer analyzer;
73-
private final Environment env;
7471

75-
AdminServiceHandler(AdminService.Draft adminService, PersistenceService db, Messages messages, CdsModel model, Environment env) {
72+
AdminServiceHandler(AdminService.Draft adminService, PersistenceService db, Messages messages, CdsModel model) {
7673
this.adminService = adminService;
7774
this.db = db;
7875
this.messages = messages;
79-
this.env = env;
8076

8177
// model is a tenant-dependant model proxy
8278
this.analyzer = CqnAnalyzer.create(model);

srv/src/main/java/my/bookshop/handlers/HierarchySiblingActionHandler.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import java.util.List;
66

7-
import org.springframework.context.annotation.Profile;
87
import org.springframework.stereotype.Component;
98

109
import com.sap.cds.ql.CQL;
@@ -26,7 +25,6 @@
2625
/**
2726
* Example of a custom handler for nextSiblingAction
2827
*/
29-
@Profile("cloud")
3028
public class HierarchySiblingActionHandler implements EventHandler {
3129

3230
private final PersistenceService db;

srv/src/test/java/my/bookshop/GenreHierarchyTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void testExpandNonFiction() throws Exception {
106106
void testCollapseAll() throws Exception {
107107
client.perform(get(genresURI
108108
+ "?$select=DrillState,ID,name"
109-
+ "&$apply=com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=1)"
109+
+ "&$apply=orderby(name)/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=1)"
110110
+ "&$count=true&$skip=0&$top=238"))
111111
.andExpect(status().isOk())
112112
.andExpect(jsonPath("$.value[0].name").value("Fiction"))
@@ -121,7 +121,7 @@ void testCollapseAll() throws Exception {
121121
void testExpandAll() throws Exception {
122122
String url = genresURI
123123
+ "?$select=DistanceFromRoot,DrillState,ID,LimitedDescendantCount,name"
124-
+ "&$apply=com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID')"
124+
+ "&$apply=orderby(name)/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID')"
125125
+ "&$count=true&$skip=0&$top=238";
126126

127127
ResultActions expectations = client.perform(get(url))

0 commit comments

Comments
 (0)