-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New test for header field access from spel
- Loading branch information
Showing
4 changed files
with
105 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
core/src/test/java/com/predic8/membrane/core/lang/spel/ExchangeEvaluationContextTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.predic8.membrane.core.lang.spel; | ||
|
||
import com.predic8.membrane.core.exchange.*; | ||
import com.predic8.membrane.core.http.*; | ||
import org.apache.http.client.methods.*; | ||
import org.junit.jupiter.api.*; | ||
import org.springframework.expression.*; | ||
import org.springframework.expression.spel.standard.*; | ||
|
||
import java.net.*; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class ExchangeEvaluationContextTest { | ||
|
||
Exchange exc; | ||
|
||
@BeforeEach | ||
void setup() throws URISyntaxException { | ||
exc = new Request.Builder().header("Authentication","foo").buildExchange(); | ||
|
||
|
||
} | ||
|
||
@Test | ||
void getMethod() { | ||
|
||
Expression expression = new SpelExpressionParser().parseExpression("headers.Authentication"); | ||
|
||
expression.getValue(new ExchangeEvaluationContext(exc, exc.getRequest()).getStandardEvaluationContext(), String.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters