Smoothen Speed
This commit is contained in:
parent
75a4f6524c
commit
0e092e670b
6 changed files with 291 additions and 10 deletions
|
|
@ -277,10 +277,10 @@ class AchievementServiceTest {
|
|||
@Test
|
||||
@DisplayName("Should award speed demon achievement")
|
||||
void testCheckAndAwardAchievements_SpeedDemon() {
|
||||
// Given - Activity with 50+ km/h speed (13.89+ m/s)
|
||||
// Given - Activity with 40+ km/h speed (maxSpeed is stored in km/h)
|
||||
Activity activity = createActivity(Activity.ActivityType.RIDE, 20000L, BigDecimal.ZERO);
|
||||
ActivityMetrics metrics = new ActivityMetrics();
|
||||
metrics.setMaxSpeed(BigDecimal.valueOf(15.0)); // 54 km/h
|
||||
metrics.setMaxSpeed(BigDecimal.valueOf(45.0)); // 45 km/h (realistic for cycling)
|
||||
activity.setMetrics(metrics);
|
||||
|
||||
when(activityRepository.countByUserId(userId)).thenReturn(10L);
|
||||
|
|
|
|||
|
|
@ -19,10 +19,12 @@ class FitParserIntegrationTest {
|
|||
|
||||
private FitParser parser;
|
||||
private FitFileValidator validator;
|
||||
private SpeedSmoother speedSmoother;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
parser = new FitParser();
|
||||
speedSmoother = new SpeedSmoother();
|
||||
parser = new FitParser(speedSmoother);
|
||||
validator = new FitFileValidator();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue