Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/scan-with-sonar/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ runs:
-Dsonar.projectKey=com.sap.cds.cds-ai
-Dsonar.projectVersion=${{ steps.get-revision.outputs.REVISION }}
-Dsonar.qualitygate.wait=true
-Dsonar.java.source=17
-Dsonar.java.source=21
-Dsonar.exclusions=**/samples/**,**/integration-tests/**
-Dsonar.coverage.jacoco.xmlReportPaths=${{ github.workspace }}/cds-feature-ai-core/target/site/jacoco/jacoco.xml,${{ github.workspace }}/cds-feature-recommendations/target/site/jacoco/jacoco.xml,${{ github.workspace }}/integration-tests/spring/target/site/jacoco/jacoco.xml,${{ github.workspace }}/coverage-report/target/site/jacoco-aggregate/jacoco.xml
-Dsonar.coverage.exclusions=**/src/test/**,**/src/gen/**
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java-version: [17, 21]
java-version: [21, 25]
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java-version: [17, 21]
java-version: [21, 25]
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java-version: [17, 21]
java-version: [21, 25]
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
continue-on-error: true
uses: ./.github/actions/scan-with-sonar
with:
java-version: '17'
java-version: '21'
maven-version: ${{ env.MAVEN_VERSION }}
sonarq-token: ${{ secrets.SONARQ_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -144,7 +144,7 @@ jobs:
- name: CodeQL Analysis
uses: cap-java/.github/actions/scan-with-codeql@296573b55e906f5c77a1855bcfe4285cbbc5cac4 # main
with:
java-version: '17'
java-version: '21'
maven-version: ${{ env.MAVEN_VERSION }}
language: ${{ matrix.language }}
queries: security-extended
6 changes: 6 additions & 0 deletions integration-tests/mtx-local/srv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc-test</artifactId>
Comment thread
lisajulia marked this conversation as resolved.
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
import com.sap.cds.feature.aicore.api.ResourceGroupContext;
import com.sap.cds.feature.aicore.itest.mt.utils.SubscriptionEndpointClient;
Expand All @@ -16,7 +15,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
Expand All @@ -30,14 +29,13 @@ class MtxLifecycleTest {
private static final String TENANT = "tenant-3";

@Autowired MockMvc client;
@Autowired ObjectMapper objectMapper;
@Autowired CdsRuntime runtime;

SubscriptionEndpointClient subscriptionEndpointClient;

@BeforeEach
void setup() {
subscriptionEndpointClient = new SubscriptionEndpointClient(objectMapper, client);
subscriptionEndpointClient = new SubscriptionEndpointClient(client);
}

@AfterEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
import com.sap.cds.feature.aicore.api.ResourceGroupContext;
import com.sap.cds.feature.aicore.itest.mt.utils.SubscriptionEndpointClient;
Expand All @@ -18,7 +17,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
Expand All @@ -31,14 +30,13 @@ class SubscribeUnsubscribeTest {
private static final String PRODUCTS_URL = "/odata/v4/MtTestService/Products";

@Autowired MockMvc client;
@Autowired ObjectMapper objectMapper;
@Autowired CdsRuntime runtime;

SubscriptionEndpointClient subscriptionEndpointClient;

@BeforeEach
void setup() {
subscriptionEndpointClient = new SubscriptionEndpointClient(objectMapper, client);
subscriptionEndpointClient = new SubscriptionEndpointClient(client);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.sap.cds.feature.aicore.generated.cds4j.aicore.AICore_;
import com.sap.cds.feature.aicore.api.ResourceGroupContext;
import com.sap.cds.feature.aicore.core.AICoreConfig;
Expand All @@ -17,7 +16,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
Expand All @@ -28,14 +27,13 @@
class TenantIsolationTest {

@Autowired MockMvc client;
@Autowired ObjectMapper objectMapper;
@Autowired CdsRuntime runtime;

SubscriptionEndpointClient subscriptionEndpointClient;

@BeforeEach
void setup() {
subscriptionEndpointClient = new SubscriptionEndpointClient(objectMapper, client);
subscriptionEndpointClient = new SubscriptionEndpointClient(client);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ public class SubscriptionEndpointClient {

private static final String MT_SUBSCRIPTIONS_TENANTS = "/mt/v1.0/subscriptions/tenants/";

private final ObjectMapper objectMapper;
private final ObjectMapper objectMapper = new ObjectMapper();
private final MockMvc client;
private final String credentials =
"Basic " + Base64.getEncoder().encodeToString("privileged:".getBytes(StandardCharsets.UTF_8));

public SubscriptionEndpointClient(ObjectMapper objectMapper, MockMvc client) {
this.objectMapper = objectMapper;
public SubscriptionEndpointClient(MockMvc client) {
this.client = client;
}

Expand Down
6 changes: 6 additions & 0 deletions integration-tests/spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc-test</artifactId>
Comment thread
Schmarvinius marked this conversation as resolved.
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;

Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,20 @@

<properties>
<!-- OUR VERSION -->
<revision>0.0.1-alpha</revision>
<revision>0.0.2-alpha</revision>

<!-- SONAR -->
<sonar.coverage.exclusions>**/Mock*.java</sonar.coverage.exclusions>

<!-- DEPENDENCIES VERSION -->
<java.version>17</java.version>
<java.version>21</java.version>
<!-- https://central.sonatype.com/artifact/com.sap.cds/cds-services-bom/versions -->
<cds.services.version>4.9.0</cds.services.version>
<cds.services.version>5.0.0</cds.services.version>

<!-- https://central.sonatype.com/artifact/com.sap.ai.sdk/sdk-core/versions -->
<ai-sdk.version>1.19.0</ai-sdk.version>
<!-- https://central.sonatype.com/artifact/org.springframework.boot/spring-boot-dependencies/versions -->
<spring.boot.version>3.4.5</spring.boot.version>
<spring.boot.version>4.1.0</spring.boot.version>
<!-- https://central.sonatype.com/artifact/org.jacoco/jacoco-maven-plugin/versions -->
<jacoco.version>0.8.15</jacoco.version>
<!-- https://central.sonatype.com/artifact/org.junit/junit-bom/versions -->
Expand Down
6 changes: 3 additions & 3 deletions samples/bookshop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<revision>1.0.0-SNAPSHOT</revision>

<!-- DEPENDENCIES VERSION -->
<java.version>17</java.version>
<cds.services.version>4.9.0</cds.services.version>
<spring.boot.version>3.5.6</spring.boot.version>
<java.version>21</java.version>
<cds.services.version>5.0.0</cds.services.version>
<spring.boot.version>4.1.0</spring.boot.version>
<cds-starter-ai.version>0.0.1-alpha</cds-starter-ai.version>
Comment thread
Schmarvinius marked this conversation as resolved.
<cds-feature-sap-document-ai.version>0.0.1-alpha</cds-feature-sap-document-ai.version>
<cds-feature-attachments.version>1.5.0</cds-feature-attachments.version>
Expand Down
6 changes: 6 additions & 0 deletions samples/bookshop/srv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc-test</artifactId>
Comment thread
Schmarvinius marked this conversation as resolved.
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.sap.cds</groupId>
<artifactId>cds-adapter-odata-v4</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;

Expand Down
Loading