Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
java-spring-oidc-example
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
demo
java-spring-oidc-example
Commits
90c63c51
Commit
90c63c51
authored
Aug 24, 2018
by
William Loosman
Committed by
陈健
Sep 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed test code because it did not work with newer dependencies.
parent
6b5e922b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
51 deletions
+0
-51
SecurityIT.java
src/test/java/com/github/fromi/openidconnect/SecurityIT.java
+0
-51
No files found.
src/test/java/com/github/fromi/openidconnect/SecurityIT.java
deleted
100644 → 0
View file @
6b5e922b
package
com
.
github
.
fromi
.
openidconnect
;
import
static
com
.
jayway
.
restassured
.
RestAssured
.
given
;
import
static
org
.
hamcrest
.
CoreMatchers
.
endsWith
;
import
static
org
.
hamcrest
.
CoreMatchers
.
startsWith
;
import
org.apache.http.HttpStatus
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.test.IntegrationTest
;
import
org.springframework.boot.test.SpringApplicationConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
com.jayway.restassured.RestAssured
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringApplicationConfiguration
(
classes
=
Application
.
class
)
@WebAppConfiguration
@IntegrationTest
(
"server.port:0"
)
public
class
SecurityIT
{
@Value
(
"${local.server.port}"
)
int
port
;
@Before
public
void
setUp
()
{
RestAssured
.
port
=
port
;
}
@Test
public
void
welcomePageNotRedirected
()
{
given
().
redirects
().
follow
(
false
).
when
().
get
(
"/"
).
then
().
statusCode
(
HttpStatus
.
SC_OK
);
}
@Test
public
void
securedPageRedirectsToLoginPage
()
{
given
().
redirects
().
follow
(
false
).
when
().
get
(
"/test"
).
then
()
.
statusCode
(
HttpStatus
.
SC_MOVED_TEMPORARILY
)
.
header
(
"Location"
,
endsWith
(
"/login"
));
}
@Test
public
void
loginPageRedirectsToGoogle
()
{
given
().
redirects
().
follow
(
false
).
when
().
get
(
"/login"
).
then
()
.
statusCode
(
HttpStatus
.
SC_MOVED_TEMPORARILY
)
.
header
(
"Location"
,
startsWith
(
"https://dev-514378.oktapreview.com/oauth2/default/v1/authorize"
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment