-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2597 from NationalSecurityAgency/2.12.X-merge3
2.12.x merge3
- Loading branch information
Showing
9 changed files
with
194 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,14 @@ import org.apache.commons.lang3.time.DurationFormatUtils | |
import org.springframework.http.HttpEntity | ||
import org.springframework.http.HttpHeaders | ||
import org.springframework.http.MediaType | ||
import org.springframework.http.ResponseEntity | ||
import org.springframework.util.LinkedMultiValueMap | ||
import org.springframework.util.MultiValueMap | ||
import org.springframework.web.client.RestTemplate | ||
import org.springframework.web.client.HttpClientErrorException | ||
import skills.intTests.utils.DefaultIntSpec | ||
import skills.intTests.utils.EmailUtils | ||
import skills.intTests.utils.RestTemplateWrapper | ||
import skills.intTests.utils.SkillsService | ||
import skills.utils.WaitFor | ||
import spock.lang.IgnoreIf | ||
|
@@ -39,6 +41,7 @@ class PasswordResetSpec extends DefaultIntSpec { | |
|
||
GreenMail greenMail = new GreenMail(ServerSetupTest.SMTP) | ||
SkillsService rootSkillsService | ||
RestTemplate template = new RestTemplate() | ||
|
||
def setup() { | ||
greenMail.start() | ||
|
@@ -57,6 +60,8 @@ class PasswordResetSpec extends DefaultIntSpec { | |
"publicUrl" : "http://localhost:${localPort}/".toString(), | ||
"fromEmail" : "resetspec@skilltreetests" | ||
]) | ||
template.interceptors.add(new RestTemplateWrapper.StatefulRestTemplateInterceptor()) | ||
template.getForEntity("http://localhost:${localPort}/app/users/validExistingDashboardUserId/[email protected]", String.class) | ||
} | ||
|
||
def cleanup(){ | ||
|
@@ -69,7 +74,6 @@ class PasswordResetSpec extends DefaultIntSpec { | |
|
||
when: | ||
//post request with an unauthenticated client to ensure that the url is publicly available | ||
RestTemplate template = new RestTemplate() | ||
HttpHeaders headers = new HttpHeaders() | ||
headers.setContentType(MediaType.MULTIPART_FORM_DATA) | ||
MultiValueMap body = new LinkedMultiValueMap<>() | ||
|
@@ -95,7 +99,6 @@ class PasswordResetSpec extends DefaultIntSpec { | |
def "reset password with token from email"() { | ||
SkillsService aUser = createService("[email protected]", "somepassword") | ||
//post request with an unauthenticated client to ensure that the url is publicly available | ||
RestTemplate template = new RestTemplate() | ||
HttpHeaders headers = new HttpHeaders() | ||
headers.setContentType(MediaType.MULTIPART_FORM_DATA) | ||
MultiValueMap body = new LinkedMultiValueMap<>() | ||
|
@@ -131,7 +134,6 @@ class PasswordResetSpec extends DefaultIntSpec { | |
def "reset password with invalid token fails"() { | ||
SkillsService aUser = createService("[email protected]", "somepassword") | ||
//post request with an unauthenticated client to ensure that the url is publicly available | ||
RestTemplate template = new RestTemplate() | ||
HttpHeaders headers = new HttpHeaders() | ||
headers.setContentType(MediaType.MULTIPART_FORM_DATA) | ||
MultiValueMap body = new LinkedMultiValueMap<>() | ||
|
@@ -164,7 +166,6 @@ class PasswordResetSpec extends DefaultIntSpec { | |
|
||
SkillsService aUser = createService("[email protected]", "somepassword") | ||
//post request with an unauthenticated client to ensure that the url is publicly available | ||
RestTemplate template = new RestTemplate() | ||
HttpHeaders headers = new HttpHeaders() | ||
headers.setContentType(MediaType.MULTIPART_FORM_DATA) | ||
MultiValueMap body = new LinkedMultiValueMap<>() | ||
|
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
Oops, something went wrong.