• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ExpediaGroup / beekeeper / #815

07 Apr 2026 07:33PM UTC coverage: 87.706% (-0.07%) from 87.774%
#815

push

web-flow
Merge df58fae27 into 2a21fe15a

10 of 12 new or added lines in 3 files covered. (83.33%)

115 existing lines in 33 files now uncovered.

1541 of 1757 relevant lines covered (87.71%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.83
/beekeeper-api/src/main/java/com/expediagroup/beekeeper/api/response/PathResponseConverter.java
1
/**
2
 * Copyright (C) 2019-2023 Expedia, Inc.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package com.expediagroup.beekeeper.api.response;
17

18
import java.util.ArrayList;
19
import java.util.List;
20

21
import org.springframework.data.domain.Page;
22
import org.springframework.data.domain.PageImpl;
23

24
import com.expediagroup.beekeeper.core.model.HousekeepingPath;
25

26
/*
27
Ideally, this should be done with Spring projections (See https://www.baeldung.com/spring-data-jpa-projections)
28
but currently projections do not support using Specification (See https://github.com/spring-projects/spring-data-jpa/issues/1378).
29

30
Therefore, this is a 'manual' conversion of the HousekeepingPath object, which will be used in the API.
UNCOV
31
*/
×
32

33
public class PathResponseConverter {
34

35
  private static HousekeepingPathResponse convertToHousekeepingPathResponse(HousekeepingPath housekeepingPath) {
1✔
36
    return HousekeepingPathResponse
1✔
37
        .builder()
1✔
38
        .path(housekeepingPath.getPath())
1✔
39
        .databaseName(housekeepingPath.getDatabaseName())
1✔
40
        .tableName(housekeepingPath.getTableName())
1✔
41
        .housekeepingStatus(housekeepingPath.getHousekeepingStatus())
1✔
42
        .creationTimestamp(housekeepingPath.getCreationTimestamp())
1✔
43
        .modifiedTimestamp(housekeepingPath.getModifiedTimestamp())
1✔
44
        .cleanupTimestamp(housekeepingPath.getCleanupTimestamp())
1✔
45
        .cleanupDelay(housekeepingPath.getCleanupDelay().toString())
1✔
46
        .cleanupAttempts(housekeepingPath.getCleanupAttempts())
1✔
47
        .lifecycleType(housekeepingPath.getLifecycleType())
48
        .build();
49
  }
50

51
  public static Page<HousekeepingPathResponse> convertToHousekeepingPathResponsePage(
1✔
52
      Page<HousekeepingPath> housekeepingPathPage) {
1✔
53
    List<HousekeepingPath> housekeepingPathList = housekeepingPathPage.getContent();
1✔
54
    List<HousekeepingPathResponse> housekeepingPathResponseList = new ArrayList<>();
1✔
55
    for (HousekeepingPath housekeepingPath : housekeepingPathList) {
1✔
56
      HousekeepingPathResponse housekeepingPathResponse = convertToHousekeepingPathResponse(housekeepingPath);
1✔
57
      housekeepingPathResponseList.add(housekeepingPathResponse);
1✔
58
    }
1✔
59
    PageImpl<HousekeepingPathResponse> housekeepingPathResponses = new PageImpl<>(
60
        housekeepingPathResponseList, housekeepingPathPage.getPageable(), housekeepingPathPage.getTotalElements());
61
    return housekeepingPathResponses;
1✔
62
  }
1✔
63

1✔
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc