Skip to content

Commit

Permalink
#1709 change cell_area_code/location_id to long
Browse files Browse the repository at this point in the history
  • Loading branch information
cproof committed Aug 21, 2024
1 parent affb0fd commit e7cc154
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public CellLocation cellLocationRequestToCellLocation(CellLocationRequest cellLo
.test(test)
.openTestUUID(test.getOpenTestUuid())
.areaCode(cellLocationRequest.getAreaCode())
.locationId(cellLocationRequest.getLocationId() == null ? null : cellLocationRequest.getLocationId().intValue())
.locationId(cellLocationRequest.getLocationId())
.primaryScramblingCode(cellLocationRequest.getPrimaryScramblingCode())
.time(TimeUtils.getZonedDateTimeFromMillisAndTimezone(cellLocationRequest.getTime(), test.getTimezone()))
.timeNs(cellLocationRequest.getTimeNs())
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/at/rtr/rmbt/model/CellLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public class CellLocation {
private UUID openTestUUID;

@Column(name = "location_id")
private Integer locationId;
private Long locationId;

@Column(name = "area_code")
private Integer areaCode;
private Long areaCode;

@Column(name = "primary_scrambling_code")
private Integer primaryScramblingCode;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/rtr/rmbt/model/RadioCell.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class RadioCell implements Serializable {
private Long locationId;

@Column(name = "area_code")
private Integer areaCode;
private Long areaCode;

@Column(name = "primary_scrambling_code")
private Integer primaryScramblingCode;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/at/rtr/rmbt/model/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ public class Test implements Serializable {
private Integer landCoverObsolete;

@Column(name = "cell_location_id")
private Integer cellLocationId;
private Long cellLocationId;

@Column(name = "cell_area_code")
private Integer cellAreaCode;
private Long cellAreaCode;

@Column(name = "link_distance_obsolete")
private Integer linkDistanceObsolete;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/rtr/rmbt/request/CellLocationRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CellLocationRequest {
private final Long timeNs;

@JsonProperty(value = "area_code")
private final Integer areaCode;
private final Long areaCode;

@JsonProperty(value = "location_id")
private final Long locationId;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/rtr/rmbt/request/RadioCellRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class RadioCellRequest {
private final boolean active;

@JsonProperty(value = "area_code")
private final Integer areaCode;
private final Long areaCode;

@JsonProperty(value = "location_id")
private final Long locationId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class SignalStrengthResponse {
private final String signalStrength;

@JsonProperty(value = "ci")
private final Integer ci;
private final Long ci;

@JsonProperty(value = "tac")
private final Long tac;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public void processRadioCellRequests(Collection<RadioCellRequest> cells, Test te
Integer radioBand = null;
boolean channelChanged = false;
Integer channelNumber = null;
Integer locationId = null;
Long locationId = null;
boolean areaCodeChanged = false;
Integer areaCode = null;
Long areaCode = null;
boolean locationIdChanged = false;

List<RadioCell> newRadioCells = new ArrayList<>();
Expand All @@ -48,10 +48,10 @@ public void processRadioCellRequests(Collection<RadioCellRequest> cells, Test te
if (newRadioCell.getTechnology() != NetworkGroupName.WLAN) {

if (locationId == null && !locationIdChanged && newRadioCell.getLocationId() != null) {
locationId = newRadioCell.getLocationId().intValue();
locationId = newRadioCell.getLocationId();
} else {
if (!locationIdChanged && locationId != null && newRadioCell.getLocationId() != null &&
!locationId.equals(newRadioCell.getLocationId().intValue())) {
!locationId.equals(newRadioCell.getLocationId())) {
locationIdChanged = true;
locationId = null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/at/rtr/rmbt/TestConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ public interface TestConstants {
String DEFAULT_MCC_MNC = "1-05";
String DEFAULT_COUNTRY_AT = "AT";
String DEFAULT_COUNTRY_NO = "NO";
Integer DEFAULT_LOCATION_ID = 4;
Long DEFAULT_LOCATION_ID = 4L;
Long DEFAULT_LOCATION_ID_LONG = 4L;
Integer DEFAULT_AREA_CODE_FIRST = 3;
Integer DEFAULT_AREA_CODE_SECOND = 65;
Long DEFAULT_AREA_CODE_FIRST = 3L;
Long DEFAULT_AREA_CODE_SECOND = 65L;
Integer DEFAULT_PRIMARY_SCRAMBLING_CODE = 2147483647;
NetworkGroupName DEFAULT_TECHNOLOGY_FIRST = NetworkGroupName.G2;
NetworkGroupName DEFAULT_TECHNOLOGY_SECOND = NetworkGroupName.G3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void cellLocationRequestToCellLocation_whenCommonData_expectCellLocation(
when(test.getOpenTestUuid()).thenReturn(TestConstants.DEFAULT_TEST_UUID);
when(test.getTimezone()).thenReturn(TestConstants.DEFAULT_TIMEZONE);
when(cellLocationRequest.getAreaCode()).thenReturn(TestConstants.DEFAULT_AREA_CODE_FIRST);
when(cellLocationRequest.getLocationId()).thenReturn(TestConstants.DEFAULT_LOCATION_ID.longValue());
when(cellLocationRequest.getLocationId()).thenReturn(TestConstants.DEFAULT_LOCATION_ID);
when(cellLocationRequest.getPrimaryScramblingCode()).thenReturn(TestConstants.DEFAULT_PRIMARY_SCRAMBLING_CODE);
when(cellLocationRequest.getTimeNs()).thenReturn(TestConstants.DEFAULT_TIME_NS);
when(cellLocationRequest.getTime()).thenReturn(TestConstants.DEFAULT_TIME_INSTANT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void processRadioCellRequests_whenLocationNotChangedAndAreaCodeNotChanged

verify(radioCellRepository).saveAll(List.of(radioCellFirst, radioCellSecond));
verify(test).setRadioBand(TestConstants.DEFAULT_BAND);
verify(test).setCellLocationId(TestConstants.DEFAULT_GEO_LOCATION_UID_FIRST.intValue());
verify(test).setCellLocationId(TestConstants.DEFAULT_GEO_LOCATION_UID_FIRST);
verify(test).setCellAreaCode(TestConstants.DEFAULT_AREA_CODE_FIRST);
verify(test).setChannelNumber(TestConstants.DEFAULT_CHANNEL_NUMBER_FIRST);
}
Expand Down

0 comments on commit e7cc154

Please sign in to comment.