mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-08-10 21:31:00 +00:00
Merge pull request #31 from nagisa77/codex/fix-nosuchelementexception-in-publishmodeintegrationtest
Update integration test passwords
This commit is contained in:
@@ -33,12 +33,12 @@ class ComplexFlowIntegrationTest {
|
|||||||
HttpHeaders h = new HttpHeaders();
|
HttpHeaders h = new HttpHeaders();
|
||||||
h.setContentType(MediaType.APPLICATION_JSON);
|
h.setContentType(MediaType.APPLICATION_JSON);
|
||||||
rest.postForEntity("/api/auth/register", new HttpEntity<>(
|
rest.postForEntity("/api/auth/register", new HttpEntity<>(
|
||||||
Map.of("username", username, "email", email, "password", "pass"), h), Map.class);
|
Map.of("username", username, "email", email, "password", "pass123"), h), Map.class);
|
||||||
User u = users.findByUsername(username).orElseThrow();
|
User u = users.findByUsername(username).orElseThrow();
|
||||||
rest.postForEntity("/api/auth/verify", new HttpEntity<>(
|
rest.postForEntity("/api/auth/verify", new HttpEntity<>(
|
||||||
Map.of("username", username, "code", u.getVerificationCode()), h), Map.class);
|
Map.of("username", username, "code", u.getVerificationCode()), h), Map.class);
|
||||||
ResponseEntity<Map> resp = rest.postForEntity("/api/auth/login", new HttpEntity<>(
|
ResponseEntity<Map> resp = rest.postForEntity("/api/auth/login", new HttpEntity<>(
|
||||||
Map.of("username", username, "password", "pass"), h), Map.class);
|
Map.of("username", username, "password", "pass123"), h), Map.class);
|
||||||
return (String) resp.getBody().get("token");
|
return (String) resp.getBody().get("token");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ class PublishModeIntegrationTest {
|
|||||||
HttpHeaders h = new HttpHeaders();
|
HttpHeaders h = new HttpHeaders();
|
||||||
h.setContentType(MediaType.APPLICATION_JSON);
|
h.setContentType(MediaType.APPLICATION_JSON);
|
||||||
rest.postForEntity("/api/auth/register", new HttpEntity<>(
|
rest.postForEntity("/api/auth/register", new HttpEntity<>(
|
||||||
Map.of("username", username, "email", email, "password", "pass"), h), Map.class);
|
Map.of("username", username, "email", email, "password", "pass123"), h), Map.class);
|
||||||
User u = users.findByUsername(username).orElseThrow();
|
User u = users.findByUsername(username).orElseThrow();
|
||||||
rest.postForEntity("/api/auth/verify", new HttpEntity<>(
|
rest.postForEntity("/api/auth/verify", new HttpEntity<>(
|
||||||
Map.of("username", username, "code", u.getVerificationCode()), h), Map.class);
|
Map.of("username", username, "code", u.getVerificationCode()), h), Map.class);
|
||||||
ResponseEntity<Map> resp = rest.postForEntity("/api/auth/login", new HttpEntity<>(
|
ResponseEntity<Map> resp = rest.postForEntity("/api/auth/login", new HttpEntity<>(
|
||||||
Map.of("username", username, "password", "pass"), h), Map.class);
|
Map.of("username", username, "password", "pass123"), h), Map.class);
|
||||||
return (String) resp.getBody().get("token");
|
return (String) resp.getBody().get("token");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user