Skip to content

Commit 0d32dd8

Browse files
add missing start scripts to JwtVerificationExample (#2580)
1 parent 1ff2c61 commit 0d32dd8

3 files changed

Lines changed: 45 additions & 5 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@echo off
2+
setlocal EnableExtensions
3+
4+
set "SCRIPT_DIR=%~dp0"
5+
if "%SCRIPT_DIR:~-1%"=="\" set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
6+
7+
set "dir=%SCRIPT_DIR%"
8+
9+
:search_up
10+
if exist "%dir%\LICENSE.txt" if exist "%dir%\scripts\run-membrane.cmd" goto found
11+
for %%A in ("%dir%\..") do set "next=%%~fA"
12+
if /I "%next%"=="%dir%" goto notfound
13+
set "dir=%next%"
14+
goto search_up
15+
16+
:found
17+
set "MEMBRANE_HOME=%dir%"
18+
set "MEMBRANE_CALLER_DIR=%SCRIPT_DIR%"
19+
call "%MEMBRANE_HOME%\scripts\run-membrane.cmd" %*
20+
exit /b %ERRORLEVEL%
21+
22+
:notfound
23+
>&2 echo Could not locate Membrane root. Ensure directory structure is correct.
24+
exit /b 1
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
# Default: ./proxies.xml (next to this script); fallback -> $MEMBRANE_HOME/conf/proxies.xml
3+
# JAVA_OPTS: relative -D paths are auto-resolved against $MEMBRANE_HOME (absolute/URI unchanged).
4+
# Examples:
5+
# export JAVA_OPTS='-Dlog4j.configurationFile=examples/logging/access/log4j2_access.xml'
6+
# export JAVA_OPTS='-Dlog4j.configurationFile=/abs/path/log4j2.xml'
7+
8+
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
9+
10+
dir="$SCRIPT_DIR"
11+
while [ "$dir" != "/" ]; do
12+
if [ -f "$dir/LICENSE.txt" ] && [ -f "$dir/scripts/run-membrane.sh" ]; then
13+
export MEMBRANE_HOME="$dir"
14+
export MEMBRANE_CALLER_DIR="$SCRIPT_DIR"
15+
exec sh "$dir/scripts/run-membrane.sh" "$@"
16+
fi
17+
dir=$(dirname "$dir")
18+
done
19+
20+
echo "Could not locate Membrane root. Ensure directory structure is correct." >&2
21+
exit 1

distribution/src/test/java/com/predic8/membrane/examples/withoutinternet/JwtVerificationExampleTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@
1414

1515
package com.predic8.membrane.examples.withoutinternet;
1616

17-
import com.predic8.membrane.core.http.Header;
1817
import com.predic8.membrane.examples.util.AbstractSampleMembraneStartStopTestcase;
19-
import org.jetbrains.annotations.NotNull;
2018
import org.junit.jupiter.api.Test;
2119

22-
import java.util.concurrent.atomic.AtomicBoolean;
23-
2420
import static io.restassured.RestAssured.given;
25-
import static org.junit.jupiter.api.Assertions.assertTrue;
2621

2722
public class JwtVerificationExampleTest extends AbstractSampleMembraneStartStopTestcase {
2823

0 commit comments

Comments
 (0)