Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Upgrade spring version (#1384)
Browse files Browse the repository at this point in the history
* Upgrade gradlew version

* Upgrade Spring version but keep junit version to 4

* Remove junit depedency specification from the main gradle file

* Make tests happy

* Treat realms configuration as an array
  • Loading branch information
tor-vs-floki authored Apr 4, 2022
1 parent fc62219 commit 76fd74d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 24 deletions.
2 changes: 2 additions & 0 deletions acceptance-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ dependencies {
testRuntime 'org.pegdown:pegdown:1.6.0'
testCompile project(path: ':core-common', configuration: 'testOutput')
testCompile project(path: ':core-services', configuration: 'testOutput')

testCompile 'junit:junit:4.13.1'
}

task acceptanceTest(type: Test) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import static org.springframework.http.HttpMethod.DELETE;
import static org.springframework.http.HttpMethod.GET;
Expand All @@ -55,7 +57,7 @@ public class SecurityConfiguration extends ResourceServerConfigurerAdapter {
private String uidScope;

@Value("${nakadi.oauth2.realms}")
private String realms;
private String[] realms;

@Value("${nakadi.oauth2.scopes.nakadiAdmin}")
private String nakadiAdminScope;
Expand All @@ -73,8 +75,11 @@ public static String hasScope(final String scope) {
return MessageFormat.format("#oauth2.hasScope(''{0}'')", scope);
}

public static String hasUidScopeAndAnyRealm(final String realms) {
return MessageFormat.format("#oauth2.hasUidScopeAndAnyRealm(''{0}'')", realms);
public static String hasUidScopeAndAnyRealm(final String[] realms) {
final String formattedRealms = Arrays.stream(realms)
.map(r -> MessageFormat.format("''{0}''", r))
.collect(Collectors.joining(","));
return MessageFormat.format("#oauth2.hasUidScopeAndAnyRealm({0})", formattedRealms);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
subprojects {
buildscript {
ext {
springBootVersion = '2.3.1.RELEASE'
springBootVersion = '2.5.12'
}
repositories {
mavenCentral()
Expand Down
1 change: 1 addition & 0 deletions core-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ dependencies {
exclude module: "hamcrest-library"
}
testCompile 'com.jayway.jsonpath:json-path'
testCompile 'junit:junit:4.13.1'
testRuntime 'org.pegdown:pegdown:1.6.0'
}
// end::dependencies[]
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
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-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,29 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down

0 comments on commit 76fd74d

Please sign in to comment.