Skip to content

Commit 48ba842

Browse files
fix: Grounding getAllPipelines now does not throw anymore (#509)
* fix grounding e2e test * Formatting * minor --------- Co-authored-by: Jonas Israel <[email protected]> Co-authored-by: SAP Cloud SDK Bot <[email protected]>
1 parent 45a52ab commit 48ba842

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/GroundingTest.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.sap.ai.sdk.app.controllers;
22

33
import static com.sap.ai.sdk.app.controllers.GroundingController.RESOURCE_GROUP;
4-
import static com.sap.ai.sdk.app.controllers.GroundingController.RESOURCE_GROUP_JS;
54
import static java.time.LocalDate.now;
65
import static org.assertj.core.api.Assertions.assertThat;
76
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -19,7 +18,6 @@
1918
import java.util.UUID;
2019
import org.junit.jupiter.api.Disabled;
2120
import org.junit.jupiter.api.Test;
22-
import org.springframework.web.client.HttpClientErrorException.NotFound;
2321

2422
class GroundingTest {
2523
private static final String JSON_FORMAT = "json";
@@ -28,18 +26,13 @@ class GroundingTest {
2826
void testPipelinesGetAll() {
2927
final var controller = new GroundingController();
3028

31-
// Java has no pipelines, it returns 404 for whatever reason
32-
assertThatThrownBy(() -> controller.getAllPipelines(JSON_FORMAT, RESOURCE_GROUP))
33-
.isExactlyInstanceOf(NotFound.class)
34-
.hasMessageContaining("404");
35-
36-
// JS has 2 pipelines
37-
final var result = controller.getAllPipelines(JSON_FORMAT, RESOURCE_GROUP_JS);
29+
// we don't have testable data yet, but the endpoint works without errors
30+
var result = controller.getAllPipelines(JSON_FORMAT, RESOURCE_GROUP);
3831
assertThat(result).isInstanceOf(GetPipelines.class);
39-
final var pipelinesList = ((GetPipelines) result).getResources();
40-
assertThat(pipelinesList).hasSize(2);
41-
final var pipelinesCount = ((GetPipelines) result).getCount();
42-
assertThat(pipelinesCount).isEqualTo(2);
32+
var pipelinesList = ((GetPipelines) result).getResources();
33+
assertThat(pipelinesList).isEmpty();
34+
var pipelinesCount = ((GetPipelines) result).getCount();
35+
assertThat(pipelinesCount).isEqualTo(0);
4336
}
4437

4538
@Test

0 commit comments

Comments
 (0)