-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close: #1084
- Loading branch information
Showing
2 changed files
with
53 additions
and
1 deletion.
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
31 changes: 31 additions & 0 deletions
31
...proxy/src/test/groovy/io/micronaut/function/aws/proxy/MicronautAwsProxyRequestSpec.groovy
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,31 @@ | ||
package io.micronaut.function.aws.proxy | ||
|
||
import com.amazonaws.serverless.proxy.internal.jaxrs.AwsProxySecurityContext | ||
import com.amazonaws.serverless.proxy.model.AwsProxyRequest | ||
import spock.lang.Specification | ||
|
||
class MicronautAwsProxyRequestSpec extends Specification { | ||
|
||
void "MicronautAwsProxyRequest::isSecurityContextPresent does not throw NPE"() { | ||
when: | ||
boolean isPresent = MicronautAwsProxyRequest.isSecurityContextPresent(null) | ||
|
||
then: | ||
noExceptionThrown() | ||
!isPresent | ||
|
||
when: | ||
isPresent = MicronautAwsProxyRequest.isSecurityContextPresent(new AwsProxySecurityContext(null, null)) | ||
|
||
then: | ||
noExceptionThrown() | ||
!isPresent | ||
|
||
when: | ||
isPresent = MicronautAwsProxyRequest.isSecurityContextPresent(new AwsProxySecurityContext(null, new AwsProxyRequest())) | ||
|
||
then: | ||
noExceptionThrown() | ||
!isPresent | ||
} | ||
} |