15
15
*/
16
16
package org .springframework .data .jpa .repository .query ;
17
17
18
- import static org .assertj .core .api .Assertions .*;
18
+ import static org .hamcrest .CoreMatchers .*;
19
+ import static org .junit .Assert .*;
19
20
import static org .mockito .Mockito .*;
20
21
21
22
import java .util .Arrays ;
26
27
import javax .persistence .Tuple ;
27
28
import javax .persistence .TupleElement ;
28
29
29
- import org .assertj .core .api .SoftAssertions ;
30
30
import org .junit .Before ;
31
31
import org .junit .Test ;
32
32
import org .junit .runner .RunWith ;
@@ -74,7 +74,7 @@ public void returnsSingleTupleElementIfItMatchesExpectedType() {
74
74
75
75
TupleConverter converter = new TupleConverter (type );
76
76
77
- assertThat (converter .convert (tuple )). isEqualTo ( "Foo" );
77
+ assertThat (converter .convert (tuple ), is (( Object ) "Foo" ) );
78
78
}
79
79
80
80
@ Test // DATAJPA-1024
@@ -86,11 +86,11 @@ public void returnsNullForSingleElementTupleWithNullValue() {
86
86
87
87
TupleConverter converter = new TupleConverter (type );
88
88
89
- assertThat (converter .convert (tuple )). isNull ( );
89
+ assertThat (converter .convert (tuple ), is ( nullValue ()) );
90
90
}
91
91
92
- @ SuppressWarnings ("unchecked" )
93
92
@ Test // DATAJPA-1048
93
+ @ SuppressWarnings ("unchecked" )
94
94
public void findsValuesForAllVariantsSupportedByTheTuple () {
95
95
96
96
Tuple tuple = new MockTuple ();
@@ -99,14 +99,10 @@ public void findsValuesForAllVariantsSupportedByTheTuple() {
99
99
100
100
Map <String , Object > map = (Map <String , Object >) converter .convert (tuple );
101
101
102
- SoftAssertions softly = new SoftAssertions ();
103
-
104
- softly .assertThat (map .get ("ONE" )).isEqualTo ("one" );
105
- softly .assertThat (map .get ("one" )).isEqualTo ("one" );
106
- softly .assertThat (map .get ("OnE" )).isEqualTo ("one" );
107
- softly .assertThat (map .get ("oNe" )).isEqualTo ("one" );
108
-
109
- softly .assertAll ();
102
+ assertThat (map .get ("ONE" ), is ((Object ) "one" ));
103
+ assertThat (map .get ("one" ), is ((Object ) "one" ));
104
+ assertThat (map .get ("OnE" ), is ((Object ) "one" ));
105
+ assertThat (map .get ("oNe" ), is ((Object ) "one" ));
110
106
}
111
107
112
108
interface SampleRepository extends CrudRepository <Object , Long > {
@@ -151,7 +147,7 @@ public Object[] toArray() {
151
147
152
148
@ Override
153
149
public List <TupleElement <?>> getElements () {
154
- return Arrays .asList (one , two );
150
+ return Arrays .< TupleElement <?>> asList (one , two );
155
151
}
156
152
157
153
private static class StringTupleElement implements TupleElement <String > {
0 commit comments