Skip to content

Commit

Permalink
Update GenreHierarchyTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermarc authored Dec 20, 2024
1 parent 2f724b2 commit d49a3e1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions srv/src/test/java/my/bookshop/GenreHierarchyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,18 @@ void testFilterExpandLevels() throws Exception {
@Test
@WithMockUser(username = "admin")
void testStartTwoLevelsOrderByDescHANA() throws Exception {
assumeThat(env.getActiveProfiles()).contains("cloud");
client.perform(get(genresURI
+ "?$select=DrillState,ID,name,DistanceFromRoot"
+ "&$apply=orderby(name desc)/"
+ "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=2)"
+ "&$count=true"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.value[0].ID").value(200))
.andExpect(jsonPath("$.value[1].ID").value(204))
.andExpect(jsonPath("$.value[20].ID").value(101))
.andExpect(jsonPath("$.value[21]").doesNotExist());
if (isOnHana()) {
client.perform(get(genresURI
+ "?$select=DrillState,ID,name,DistanceFromRoot"
+ "&$apply=orderby(name desc)/"
+ "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=2)"
+ "&$count=true"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.value[0].ID").value(200))
.andExpect(jsonPath("$.value[1].ID").value(204))
.andExpect(jsonPath("$.value[20].ID").value(101))
.andExpect(jsonPath("$.value[21]").doesNotExist());
}
}

private boolean isOnHana() {
Expand Down

0 comments on commit d49a3e1

Please sign in to comment.