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
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,20 @@ jobs:
CTP_CLIENT_SECRET: ${{ secrets.CTP_CLIENT_SECRET }}
CTP_PROJECT_KEY: ${{ secrets.CTP_PROJECT_KEY }}

- name: Setup Java 21 for Spring examples
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
with:
distribution: 'temurin'
java-version: '21'
- name: Test Spring examples
run: |
cd examples/spring && ./gradlew test
cd ../spring-datadog && ./gradlew test
cd ../spring-datadog-statsd && ./gradlew test
cd ../spring-dynatrace-oneagent && ./gradlew test
cd ../spring-newrelic && ./gradlew test
cd ../spring-otel && ./gradlew test

- name: Collect code coverage
run: ./gradlew codeCoverageReport

Expand Down
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ plugins {
id "srcinfo"
}

/*
dependencies {
runtimeOnly 'org.springframework.boot:spring-boot-properties-migrator'
}*/


import java.text.SimpleDateFormat

apply plugin: 'versioning'
Expand Down
2 changes: 2 additions & 0 deletions commercetools/commercetools-sdk-java-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,15 @@ tasks.register('runMainMethodThreadLeakTest', JavaExec) {
classpath = sourceSets.test.runtimeClasspath
mainClass = "com.commercetools.MainMethodThreadLeakTest"
timeout = Duration.ofSeconds(20)
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(21) }
}
tasks.register('runMainMethodMemoryLeakTest', JavaExec) {
group = "Execution"
description = "Run the main method thread leak test class"
classpath = sourceSets.test.runtimeClasspath
mainClass = "com.commercetools.MainMethodMemoryLeakTest"
maxHeapSize("128m")
javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(21) }
}


Expand Down
6 changes: 3 additions & 3 deletions examples/spring-datadog-statsd/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '4.0.5'
id 'io.spring.dependency-management' version '1.1.7'
}

group = 'com.commercetools.sdk.examples'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
http
.anonymous(anonymous -> anonymous.authorities("ROLE_ANON"))
.authorizeHttpRequests((requests) -> requests
.requestMatchers("**").permitAll()
.requestMatchers("/**").permitAll()
.requestMatchers("/resources/**").permitAll()
.anyRequest().permitAll()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5063,7 +5063,7 @@ jQuery.event = {
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector ||
selector === "**" && handleObj.selector ) ) {
selector === "/**" && handleObj.selector ) ) {
handlers.splice( j, 1 );

if ( handleObj.selector ) {
Expand Down Expand Up @@ -10555,8 +10555,8 @@ jQuery.fn.extend( {

// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
this.off( selector, "/**" ) :
this.off( types, selector || "/**", fn );
},

hover: function( fnOver, fnOut ) {
Expand Down

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions examples/spring-datadog/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '4.0.5'
id 'io.spring.dependency-management' version '1.1.7'
id "de.undercouch.download" version "5.3.0"
}

Expand All @@ -10,7 +10,7 @@ version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}

Expand All @@ -29,12 +29,12 @@ dependencies {
implementation "com.commercetools.sdk:commercetools-sdk-java-api:${versions.commercetools}"
implementation "com.commercetools.sdk:commercetools-apachehttp-client:${versions.commercetools}"
implementation "com.commercetools.sdk:commercetools-monitoring-datadog:${versions.commercetools}"
implementation 'javax.inject:javax.inject:1'
implementation 'jakarta.inject:jakarta.inject-api:2.0.1'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.session:spring-session-core'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6:3.1.2.RELEASE'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
implementation "com.datadoghq:datadog-api-client:2.20.0"
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,40 +52,34 @@ public CtpSecurityConfig(
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) throws Exception {
ServerSecurityContextRepository securityContextRepository = new WebSessionServerSecurityContextRepository();
return http.securityContextRepository(securityContextRepository)
.anonymous()
.and()
.anonymous(anonymous -> anonymous.authorities("ROLE_ANON"))
.addFilterBefore(new LoginWebFilter(authenticationManagerResolver, securityContextRepository),
SecurityWebFiltersOrder.FORM_LOGIN)
.logout()
.logoutUrl("/logout")
.requiresLogout(ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, "/logout"))
.logoutHandler(new DelegatingServerLogoutHandler(new WebSessionServerLogoutHandler(),
new SecurityContextServerLogoutHandler()))
.logoutSuccessHandler(new RedirectServerLogoutSuccessHandler())
.and()
.formLogin()
.loginPage("/login")
.requiresAuthenticationMatcher(ServerWebExchangeMatchers.pathMatchers("none"))
.authenticationManager(Mono::just)
.and()
.authorizeExchange()
.pathMatchers("/login")
.permitAll()
.pathMatchers("/")
.permitAll()
.pathMatchers("/resources/**")
.permitAll()
.pathMatchers("/home")
.permitAll()
.pathMatchers("/p/**")
.permitAll()
.pathMatchers("/cart/**")
.permitAll()
.pathMatchers("/me/**")
.authenticated()
.anyExchange()
.authenticated()
.and()
.logout(logoutSpec -> logoutSpec.logoutUrl("/logout")
.requiresLogout(ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, "/logout"))
.logoutHandler(new DelegatingServerLogoutHandler(new WebSessionServerLogoutHandler(),
new SecurityContextServerLogoutHandler()))
.logoutSuccessHandler(new RedirectServerLogoutSuccessHandler())
)
.formLogin(formLoginSpec -> formLoginSpec.loginPage("/login")
.requiresAuthenticationMatcher(ServerWebExchangeMatchers.pathMatchers("none"))
.authenticationManager(Mono::just))
.authorizeExchange(authorizeExchangeSpec -> authorizeExchangeSpec.pathMatchers("/login")
.permitAll()
.pathMatchers("/")
.permitAll()
.pathMatchers("/resources/**")
.permitAll()
.pathMatchers("/home")
.permitAll()
.pathMatchers("/p/**")
.permitAll()
.pathMatchers("/cart/**")
.permitAll()
.pathMatchers("/me/**")
.authenticated()
.anyExchange()
.authenticated())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5063,7 +5063,7 @@ jQuery.event = {
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector ||
selector === "**" && handleObj.selector ) ) {
selector === "/**" && handleObj.selector ) ) {
handlers.splice( j, 1 );

if ( handleObj.selector ) {
Expand Down Expand Up @@ -10555,8 +10555,8 @@ jQuery.fn.extend( {

// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
this.off( selector, "/**" ) :
this.off( types, selector || "/**", fn );
},

hover: function( fnOver, fnOut ) {
Expand Down

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/spring-dynatrace-oneagent/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '4.0.5'
id 'io.spring.dependency-management' version '1.1.7'
}

group = 'com.commercetools.sdk.examples'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
http
.anonymous(anonymous -> anonymous.authorities("ROLE_ANON"))
.authorizeHttpRequests((requests) -> requests
.requestMatchers("**").permitAll()
.requestMatchers("/**").permitAll()
.requestMatchers("/resources/**").permitAll()
.anyRequest().permitAll()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5063,7 +5063,7 @@ jQuery.event = {
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector ||
selector === "**" && handleObj.selector ) ) {
selector === "/**" && handleObj.selector ) ) {
handlers.splice( j, 1 );

if ( handleObj.selector ) {
Expand Down Expand Up @@ -10555,8 +10555,8 @@ jQuery.fn.extend( {

// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
this.off( selector, "/**" ) :
this.off( types, selector || "/**", fn );
},

hover: function( fnOver, fnOut ) {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
@SpringBootTest(properties = {
"ctp.client.id=test-client-id",
"ctp.client.secret=test-client-secret",
"ctp.project.key=test-project-key"
})
class SpringmvcApplicationTests {

@Test
Expand Down
6 changes: 3 additions & 3 deletions examples/spring-newrelic/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '4.0.5'
id 'io.spring.dependency-management' version '1.1.7'
id "de.undercouch.download" version "5.3.0"
}

Expand All @@ -10,7 +10,7 @@ version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.server.SecurityWebFilterChain;
import org.springframework.security.web.server.context.ServerSecurityContextRepository;
import org.springframework.security.web.server.context.WebSessionServerSecurityContextRepository;

@Configuration
@EnableWebSecurity
Expand All @@ -21,7 +17,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
http
.anonymous(anonymous -> anonymous.authorities("ROLE_ANON"))
.authorizeHttpRequests((requests) -> requests
.requestMatchers("**").permitAll()
.requestMatchers("/**").permitAll()
.requestMatchers("/resources/**").permitAll()
.anyRequest().permitAll()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5063,7 +5063,7 @@ jQuery.event = {
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector ||
selector === "**" && handleObj.selector ) ) {
selector === "/**" && handleObj.selector ) ) {
handlers.splice( j, 1 );

if ( handleObj.selector ) {
Expand Down Expand Up @@ -10555,8 +10555,8 @@ jQuery.fn.extend( {

// ( namespace ) or ( selector, types [, fn] )
return arguments.length === 1 ?
this.off( selector, "**" ) :
this.off( types, selector || "**", fn );
this.off( selector, "/**" ) :
this.off( types, selector || "/**", fn );
},

hover: function( fnOver, fnOut ) {
Expand Down

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/spring-otel/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '4.0.5'
id 'io.spring.dependency-management' version '1.1.7'
id "de.undercouch.download" version "5.3.0"
}

Expand All @@ -10,7 +10,7 @@ version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading