diff --git a/src/test/java/com/openisle/integration/PublishModeIntegrationTest.java b/src/test/java/com/openisle/integration/PublishModeIntegrationTest.java index 81ae82d11..d7755f6c0 100644 --- a/src/test/java/com/openisle/integration/PublishModeIntegrationTest.java +++ b/src/test/java/com/openisle/integration/PublishModeIntegrationTest.java @@ -36,8 +36,10 @@ class PublishModeIntegrationTest { rest.postForEntity("/api/auth/register", new HttpEntity<>( Map.of("username", username, "email", email, "password", "pass123"), h), Map.class); User u = users.findByUsername(username).orElseThrow(); - rest.postForEntity("/api/auth/verify", new HttpEntity<>( - Map.of("username", username, "code", u.getVerificationCode()), h), Map.class); + if (u.getVerificationCode() != null) { + rest.postForEntity("/api/auth/verify", new HttpEntity<>( + Map.of("username", username, "code", u.getVerificationCode()), h), Map.class); + } ResponseEntity resp = rest.postForEntity("/api/auth/login", new HttpEntity<>( Map.of("username", username, "password", "pass123"), h), Map.class); return (String) resp.getBody().get("token");