File tree Expand file tree Collapse file tree 2 files changed +3
-37
lines changed
sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers Expand file tree Collapse file tree 2 files changed +3
-37
lines changed Original file line number Diff line number Diff line change 4444 id : run_tests
4545 run : |
4646 if [ "${{ matrix.environment }}" = "canary" ]; then
47- export AICORE_SERVICE_KEY=" ${{ secrets.AI_CORE_CANARY }}"
47+ export AICORE_SERVICE_KEY=' ${{ secrets.AI_CORE_CANARY }}'
4848 else
4949 export AICORE_SERVICE_KEY='${{ secrets.AI_CORE_PRODUCTION }}'
5050 fi
7474 - name : " Start Application Locally"
7575 run : |
7676 if [ "${{ matrix.environment }}" = "canary" ]; then
77- export AICORE_SERVICE_KEY=" ${{ secrets.AI_CORE_CANARY }}"
77+ export AICORE_SERVICE_KEY=' ${{ secrets.AI_CORE_CANARY }}'
7878 else
79- export AICORE_SERVICE_KEY=" ${{ secrets.AI_CORE_PRODUCTION }}"
79+ export AICORE_SERVICE_KEY=' ${{ secrets.AI_CORE_PRODUCTION }}'
8080 fi
8181
8282 cd sample-code/spring-app
9999 # print response body with headers to stdout. q:body only O:print -:stdout S:headers
100100 run : wget -qO- -S localhost:8080
101101
102- - name : " Slack Notification"
103- if : failure()
104- 105- with :
106- webhook : ${{ secrets.SLACK_WEBHOOK }}
107- webhook-type : incoming-webhook
108- payload : |
109- blocks:
110- - type: "section"
111- text:
112- type: "mrkdwn"
113- text: "⚠️ End-to-end tests failed! 😬 Please inspect & fix by clicking <https://github.com/SAP/ai-sdk-java/actions/runs/${{ github.run_id }}|here>"
114- - type: "section"
115- text:
116- type: "plain_text"
117- text: "${{ steps.run_tests.outputs.error_message }} "
Original file line number Diff line number Diff line change @@ -318,24 +318,6 @@ void testImageInput() {
318318 assertThat (choices .get (0 ).getMessage ().getContent ()).isNotEmpty ();
319319 }
320320
321- @ Test
322- void testImageInputBase64 () {
323- String dataUrl = "" ;
324- try {
325- URL url = new URL ("https://upload.wikimedia.org/wikipedia/commons/c/c9/Sap-logo-700x700.jpg" );
326- try (InputStream inputStream = url .openStream ()) {
327- byte [] imageBytes = inputStream .readAllBytes ();
328- byte [] encodedBytes = Base64 .getEncoder ().encode (imageBytes );
329- String encodedString = new String (encodedBytes , StandardCharsets .UTF_8 );
330- dataUrl = "data:image/jpeg;base64," + encodedString ;
331- }
332- } catch (Exception e ) {
333- System .out .println ("Error fetching or reading the image from URL: " + e .getMessage ());
334- }
335- val result = service .imageInput (dataUrl ).getOriginalResponse ();
336- val choices = (result .getFinalResult ()).getChoices ();
337- assertThat (choices .get (0 ).getMessage ().getContent ()).isNotEmpty ();
338- }
339321
340322 @ Test
341323 void testMultiStringInput () {
You can’t perform that action at this time.
0 commit comments