-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
111 additions
and
65 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
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
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
23 changes: 23 additions & 0 deletions
23
core/src/test/java/io/sinistral/proteus/test/wrappers/TestClassWrapper.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,23 @@ | ||
package io.sinistral.proteus.test.wrappers; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.name.Named; | ||
import io.undertow.server.HandlerWrapper; | ||
import io.undertow.server.HttpHandler; | ||
import io.undertow.util.AttachmentKey; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class TestClassWrapper implements HandlerWrapper | ||
{ | ||
|
||
|
||
@Override | ||
public HttpHandler wrap(HttpHandler handler) | ||
{ | ||
return exchange -> { | ||
|
||
handler.handleRequest(exchange); | ||
}; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
core/src/test/java/io/sinistral/proteus/test/wrappers/TestWrapper.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,38 @@ | ||
package io.sinistral.proteus.test.wrappers; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.name.Named; | ||
import io.undertow.server.HandlerWrapper; | ||
import io.undertow.server.HttpHandler; | ||
import io.undertow.util.AttachmentKey; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class TestWrapper implements HandlerWrapper | ||
{ | ||
private static final Logger log = LoggerFactory.getLogger(TestWrapper.class.getName()); | ||
|
||
public static AttachmentKey<String> DEBUG_TEST_KEY = AttachmentKey.create(String.class); | ||
|
||
public TestWrapper() | ||
{ | ||
super(); | ||
} | ||
|
||
@Inject | ||
@Named("test.wrapper.value") | ||
private String wrapperValue; | ||
|
||
@Override | ||
public HttpHandler wrap(HttpHandler handler) | ||
{ | ||
return exchange -> { | ||
|
||
log.debug("Test wrapper"); | ||
|
||
exchange.putAttachment(DEBUG_TEST_KEY,wrapperValue); | ||
|
||
handler.handleRequest(exchange); | ||
}; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -54,7 +54,7 @@ assets { | |
|
||
} | ||
|
||
|
||
test.wrapper.value = "testValue" | ||
|
||
|
||
|
||
|