@@ -183,7 +183,7 @@ void postVerify_success() {
183
183
final String requestBody = objectMapper .writeValueAsString (request );
184
184
try (MockedStatic <Altcha > mock = Mockito .mockStatic (Altcha .class )) {
185
185
mock
186
- .when (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (false )))
186
+ .when (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (true )))
187
187
.thenReturn (true );
188
188
// --
189
189
mockMvc .perform (
@@ -194,7 +194,7 @@ void postVerify_success() {
194
194
.andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
195
195
.andExpect (jsonPath ("$.valid" , is (true )));
196
196
// --
197
- mock .verify (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (false )));
197
+ mock .verify (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (true )));
198
198
} catch (Exception e ) {
199
199
fail (e .getMessage ());
200
200
}
@@ -222,7 +222,7 @@ void postVerify_expired() {
222
222
try (MockedStatic <Altcha > mock = Mockito .mockStatic (Altcha .class )) {
223
223
// Successful request
224
224
mock
225
- .when (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (false )))
225
+ .when (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (true )))
226
226
.thenReturn (true );
227
227
mockMvc .perform (
228
228
post ("/api/v1/captcha/verify" )
@@ -231,11 +231,11 @@ void postVerify_expired() {
231
231
.andExpect (status ().isOk ())
232
232
.andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
233
233
.andExpect (jsonPath ("$.valid" , is (true )));
234
- mock .verify (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (false )));
234
+ mock .verify (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (true )));
235
235
236
236
// Expired request
237
237
mock
238
- .when (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (false )))
238
+ .when (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (true )))
239
239
.thenReturn (true );
240
240
mockMvc .perform (
241
241
post ("/api/v1/captcha/verify" )
@@ -244,7 +244,7 @@ void postVerify_expired() {
244
244
.andExpect (status ().isOk ())
245
245
.andExpect (content ().contentType (MediaType .APPLICATION_JSON ))
246
246
.andExpect (jsonPath ("$.valid" , is (false )));
247
- mock .verify (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (false )));
247
+ mock .verify (() -> Altcha .verifySolution (ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()), eq (TEST_HMAC_KEY ), eq (true )));
248
248
} catch (Exception e ) {
249
249
fail (e .getMessage ());
250
250
}
@@ -286,7 +286,7 @@ void testVerifyMetricsIncrement() {
286
286
mock .when (() -> Altcha .verifySolution (
287
287
ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()),
288
288
eq (TEST_HMAC_KEY ),
289
- eq (false )))
289
+ eq (true )))
290
290
.thenReturn (true );
291
291
292
292
for (int i = 1 ; i <= calls ; i ++) {
@@ -328,7 +328,7 @@ void testInvalidatedPayloadsGauge() {
328
328
mock .when (() -> Altcha .verifySolution (
329
329
ArgumentMatchers .<Altcha .Payload >argThat (p -> p .algorithm .isEmpty ()),
330
330
eq (TEST_HMAC_KEY ),
331
- eq (false )))
331
+ eq (true )))
332
332
.thenReturn (true );
333
333
334
334
mockMvc .perform (post ("/api/v1/captcha/verify" )
0 commit comments