@@ -37,10 +37,13 @@ class SimpleParameterAccessorUnitTests {
37
37
@ BeforeEach
38
38
void setUp () throws SecurityException , NoSuchMethodException {
39
39
40
- parameters = new DefaultParameters (Sample .class .getMethod ("sample" , String .class ));
41
- cursorRequestParameters = new DefaultParameters (Sample .class .getMethod ("sample" , ScrollPosition .class ));
42
- sortParameters = new DefaultParameters (Sample .class .getMethod ("sample1" , String .class , Sort .class ));
43
- pageableParameters = new DefaultParameters (Sample .class .getMethod ("sample2" , String .class , Pageable .class ));
40
+ parameters = new DefaultParameters (ParametersSource .of (Sample .class .getMethod ("sample" , String .class )));
41
+ cursorRequestParameters = new DefaultParameters (
42
+ ParametersSource .of (Sample .class .getMethod ("sample" , ScrollPosition .class )));
43
+ sortParameters = new DefaultParameters (
44
+ ParametersSource .of (Sample .class .getMethod ("sample1" , String .class , Sort .class )));
45
+ pageableParameters = new DefaultParameters (
46
+ ParametersSource .of (Sample .class .getMethod ("sample2" , String .class , Pageable .class )));
44
47
}
45
48
46
49
@ Test
@@ -60,8 +63,7 @@ void rejectsNullValues() {
60
63
61
64
@ Test
62
65
void rejectsTooLittleNumberOfArguments () {
63
- assertThatIllegalArgumentException ()
64
- .isThrownBy (() -> new ParametersParameterAccessor (parameters , new Object [0 ]));
66
+ assertThatIllegalArgumentException ().isThrownBy (() -> new ParametersParameterAccessor (parameters , new Object [0 ]));
65
67
}
66
68
67
69
@ Test
@@ -103,8 +105,7 @@ void returnsSortIfAvailable() {
103
105
void returnsPageableIfAvailable () {
104
106
105
107
Pageable pageable = PageRequest .of (0 , 10 );
106
- ParameterAccessor accessor = new ParametersParameterAccessor (pageableParameters ,
107
- new Object [] { "test" , pageable });
108
+ ParameterAccessor accessor = new ParametersParameterAccessor (pageableParameters , new Object [] { "test" , pageable });
108
109
109
110
assertThat (accessor .getPageable ()).isEqualTo (pageable );
110
111
assertThat (accessor .getSort ().isSorted ()).isFalse ();
@@ -115,8 +116,7 @@ void returnsSortFromPageableIfAvailable() throws Exception {
115
116
116
117
var sort = Sort .by ("foo" );
117
118
Pageable pageable = PageRequest .of (0 , 10 , sort );
118
- ParameterAccessor accessor = new ParametersParameterAccessor (pageableParameters ,
119
- new Object [] { "test" , pageable });
119
+ ParameterAccessor accessor = new ParametersParameterAccessor (pageableParameters , new Object [] { "test" , pageable });
120
120
121
121
assertThat (accessor .getPageable ()).isEqualTo (pageable );
122
122
assertThat (accessor .getSort ()).isEqualTo (sort );
0 commit comments