|
15 | 15 | */
|
16 | 16 | package org.springframework.data.jpa.repository.query;
|
17 | 17 |
|
18 |
| -import static java.util.Arrays.*; |
19 | 18 | import static jakarta.persistence.TemporalType.*;
|
| 19 | +import static java.util.Arrays.*; |
20 | 20 | import static org.mockito.ArgumentMatchers.*;
|
21 | 21 | import static org.mockito.Mockito.*;
|
22 | 22 | import static org.springframework.data.jpa.repository.query.QueryParameterSetter.ErrorHandling.*;
|
23 | 23 |
|
| 24 | +import jakarta.persistence.Parameter; |
| 25 | +import jakarta.persistence.Query; |
| 26 | +import jakarta.persistence.TemporalType; |
| 27 | +import jakarta.persistence.criteria.ParameterExpression; |
24 | 28 | import lombok.Value;
|
25 | 29 |
|
26 | 30 | import java.util.Arrays;
|
|
29 | 33 | import java.util.List;
|
30 | 34 | import java.util.function.Function;
|
31 | 35 |
|
32 |
| -import jakarta.persistence.Parameter; |
33 |
| -import jakarta.persistence.Query; |
34 |
| -import jakarta.persistence.TemporalType; |
35 |
| -import jakarta.persistence.criteria.ParameterExpression; |
36 |
| - |
37 | 36 | import org.assertj.core.api.SoftAssertions;
|
38 | 37 | import org.junit.jupiter.api.BeforeEach;
|
39 | 38 | import org.junit.jupiter.api.Test;
|
@@ -65,7 +64,9 @@ class NamedOrIndexedQueryParameterSetterUnitTests {
|
65 | 64 | void before() {
|
66 | 65 |
|
67 | 66 | JpaParametersParameterAccessor accessor = mock(JpaParametersParameterAccessor.class);
|
68 |
| - when(accessor.getValues()).thenReturn(new Object[] { new Date() }); |
| 67 | + Date date = new Date(); |
| 68 | + when(accessor.getValues()).thenReturn(new Object[] { date }); |
| 69 | + when(accessor.extractDate(date)).thenReturn(date); |
69 | 70 |
|
70 | 71 | this.methodArguments = accessor;
|
71 | 72 | }
|
|
0 commit comments