Skip to content

Commit 228e05f

Browse files
authored
Avoid assumeThat to fix Native Image tests (#424)
`assumeThat` seems to cause issues in Native Image-based test execution. Therefore using a plain old `if`.
1 parent 2f724b2 commit 228e05f

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,18 @@ void testFilterExpandLevels() throws Exception {
220220
@Test
221221
@WithMockUser(username = "admin")
222222
void testStartTwoLevelsOrderByDescHANA() throws Exception {
223-
assumeThat(env.getActiveProfiles()).contains("cloud");
224-
client.perform(get(genresURI
225-
+ "?$select=DrillState,ID,name,DistanceFromRoot"
226-
+ "&$apply=orderby(name desc)/"
227-
+ "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=2)"
228-
+ "&$count=true"))
229-
.andExpect(status().isOk())
230-
.andExpect(jsonPath("$.value[0].ID").value(200))
231-
.andExpect(jsonPath("$.value[1].ID").value(204))
232-
.andExpect(jsonPath("$.value[20].ID").value(101))
233-
.andExpect(jsonPath("$.value[21]").doesNotExist());
223+
if (isOnHana()) {
224+
client.perform(get(genresURI
225+
+ "?$select=DrillState,ID,name,DistanceFromRoot"
226+
+ "&$apply=orderby(name desc)/"
227+
+ "com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=2)"
228+
+ "&$count=true"))
229+
.andExpect(status().isOk())
230+
.andExpect(jsonPath("$.value[0].ID").value(200))
231+
.andExpect(jsonPath("$.value[1].ID").value(204))
232+
.andExpect(jsonPath("$.value[20].ID").value(101))
233+
.andExpect(jsonPath("$.value[21]").doesNotExist());
234+
}
234235
}
235236

236237
private boolean isOnHana() {

0 commit comments

Comments
 (0)