1
1
package org .heigit .ohsome .oshdb .api .tests ;
2
2
3
3
import static org .junit .jupiter .api .Assertions .assertEquals ;
4
+ import static org .junit .jupiter .api .Assertions .assertNull ;
4
5
5
6
import java .util .EnumSet ;
6
7
import java .util .HashSet ;
@@ -32,11 +33,11 @@ class HelpersOSMContributionViewTest {
32
33
33
34
private static final double DELTA = 1e-8 ;
34
35
35
- HelpersOSMContributionViewTest () throws Exception {
36
+ HelpersOSMContributionViewTest () {
36
37
oshdb = new OSHDBH2 ("../data/test-data" );
37
38
}
38
39
39
- private MapReducer <OSMContribution > createMapReducer () throws Exception {
40
+ private MapReducer <OSMContribution > createMapReducer () {
40
41
return OSMContributionView
41
42
.on (oshdb )
42
43
.areaOfInterest (bbox )
@@ -85,7 +86,7 @@ void testSum() throws Exception {
85
86
.sum (contribution -> 1 );
86
87
87
88
assertEquals (42 , result4 .get (EnumSet .of (ContributionType .CREATION ).toString ()));
88
- assertEquals ( null , result4 .get (EnumSet .of (ContributionType .DELETION ).toString ()));
89
+ assertNull ( result4 .get (EnumSet .of (ContributionType .DELETION ).toString ()));
89
90
}
90
91
91
92
@ Test
@@ -135,7 +136,7 @@ void testAverage() throws Exception {
135
136
contribution .getContributionTypes ().contains (ContributionType .TAG_CHANGE ) ? 1 : 0 )
136
137
.average ();
137
138
138
- assertEquals (1.0 , result1 . doubleValue () , DELTA );
139
+ assertEquals (1.0 , result1 , DELTA );
139
140
140
141
// many timestamps
141
142
SortedMap <OSHDBTimestamp , Double > result2 = this .createMapReducer ()
@@ -161,7 +162,7 @@ void testAverage() throws Exception {
161
162
.contains (ContributionType .CREATION ))
162
163
.average (contribution -> contribution .getEntityAfter ().getId () % 2 );
163
164
164
- assertEquals (0.5 , result4 .get (true ). doubleValue () , DELTA );
165
+ assertEquals (0.5 , result4 .get (true ), DELTA );
165
166
}
166
167
167
168
@ Test
@@ -174,7 +175,7 @@ void testWeightedAverage() throws Exception {
174
175
2 * (contribution .getEntityAfter ().getId () % 2 )
175
176
));
176
177
177
- assertEquals (1.0 , result1 . doubleValue () , DELTA );
178
+ assertEquals (1.0 , result1 , DELTA );
178
179
179
180
// many timestamps
180
181
SortedMap <OSHDBTimestamp , Double > result2 = this .createMapReducer ()
@@ -203,7 +204,7 @@ void testWeightedAverage() throws Exception {
203
204
2 * (contribution .getEntityAfter ().getId () % 2 )
204
205
));
205
206
206
- assertEquals (1.0 , result4 .get (true ). doubleValue () , DELTA );
207
+ assertEquals (1.0 , result4 .get (true ), DELTA );
207
208
}
208
209
209
210
@ Test
@@ -252,7 +253,7 @@ void testUniq() throws Exception {
252
253
.timestamps (timestamps2 )
253
254
.map (x -> null )
254
255
.uniq ();
255
- assertEquals (result5 .size (), 1 );
256
+ assertEquals (1 , result5 .size () );
256
257
}
257
258
258
259
}
0 commit comments