Skip to content

Commit

Permalink
#1713 change area_code, location_id to LONG type
Browse files Browse the repository at this point in the history
  • Loading branch information
cproof committed Aug 21, 2024
1 parent e2014d3 commit 00c731b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main/java/at/rtr/rmbt/dto/OpenTestExportResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class OpenTestExportResult extends OpenTestDTO {
private Integer landCover;

@JsonProperty("cell_area_code")
private Integer cellAreaCode;
private Long cellAreaCode;

@JsonProperty("cell_location_id")
private Integer cellLocationId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public List<OpenTestExportResult> extractData(ResultSet rs) throws SQLException,
.kgNr(rs.getObject("kg_nr", Integer.class))
.gkzSa(rs.getObject("gkz_sa", Integer.class))
.landCover(rs.getObject("land_cover", Integer.class))
.cellAreaCode(rs.getObject("cell_area_code", Integer.class))
.cellAreaCode(rs.getObject("cell_area_code", Long.class))
.cellLocationId(rs.getObject("cell_location_id", Integer.class))
.channelNumber(rs.getObject("channel_number", Integer.class))
.radioBand(rs.getObject("radio_band", Integer.class))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public List<SignalGraphItemDTO> extractData(ResultSet rsSignal) throws SQLExcept
rssnr,
rsSignal.getString("cat_technology"),
(rsSignal.getObject("location_id", Long.class) == null ? null : rsSignal.getObject("location_id", Long.class)),
rsSignal.getObject("area_code", Integer.class),
rsSignal.getObject("area_code", Long.class),
rsSignal.getObject("primary_scrambling_code", Integer.class),
rsSignal.getObject("channel_number", Integer.class),
rsSignal.getObject("timing_advance", Integer.class));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/rtr/rmbt/response/OpenTestExportDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class OpenTestExportDto {
private final Integer landCover;

@JsonProperty("cell_area_code")
private final Integer cellAreaCode;
private final Long cellAreaCode;

@JsonProperty("cell_location_id")
private final Integer cellLocationId;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/at/rtr/rmbt/response/SignalGraphItemDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class SignalGraphItemDTO {


public SignalGraphItemDTO(long timeElapsed, String networkType, Integer signalStrength, Integer lteRsrp, Integer lteRsrq, Integer lteSnr, String catTechnology,
Long locationId, Integer areaCode, Integer primaryScramblingCode, Integer channelNumber, Integer timingAdvance) {
Long locationId, Long areaCode, Integer primaryScramblingCode, Integer channelNumber, Integer timingAdvance) {
this.timeElapsed = timeElapsed;
this.networkType = networkType;
this.signalStrength = signalStrength;
Expand All @@ -73,16 +73,16 @@ public SignalGraphItemDTO(long timeElapsed, String networkType, Integer signalSt

switch (catTechnology) {
case "2G":
cellInfo2G = new CellInfo2G(locationId == null ? null: locationId.intValue(), areaCode, primaryScramblingCode, channelNumber);
cellInfo2G = new CellInfo2G(locationId == null ? null: locationId.intValue(), (areaCode == null ? null : areaCode.intValue()), primaryScramblingCode, channelNumber);
break;
case "3G":
cellInfo3G = new CellInfo3G(locationId == null ? null: locationId.intValue(), areaCode, primaryScramblingCode, channelNumber);
cellInfo3G = new CellInfo3G(locationId == null ? null: locationId.intValue(), (areaCode == null ? null : areaCode.intValue()), primaryScramblingCode, channelNumber);
break;
case "4G":
cellInfo4G = new CellInfo4G(locationId == null ? null: locationId.intValue(), areaCode, primaryScramblingCode, channelNumber);
cellInfo4G = new CellInfo4G(locationId == null ? null: locationId.intValue(), (areaCode == null ? null : areaCode.intValue()), primaryScramblingCode, channelNumber);
break;
case "5G":
cellInfo5G = new CellInfo5G(locationId, areaCode, primaryScramblingCode, channelNumber);
cellInfo5G = new CellInfo5G(locationId, (areaCode == null ? null : areaCode.intValue()), primaryScramblingCode, channelNumber);
//in case of 5G, signal strength is nr signal strength
this.lteRsrp = null;
this.lteRsrq = null;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/at/rtr/rmbt/TestConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public interface TestConstants {
Integer DEFAULT_KG_NR = 33;
Integer DEFAULT_GKZ_SA = 88;
Integer DEFAULT_LAND_COVER = 18;
Integer DEFAULT_CELL_AREA_CODE = 19;
Long DEFAULT_CELL_AREA_CODE = 19L;
Integer DEFAULT_CELL_LOCATION_ID = 20;
Integer DEFAULT_CHANNEL_NUMBER = 21;
Integer DEFAULT_RADIO_BAND = 22;
Expand All @@ -104,7 +104,7 @@ public interface TestConstants {
Timestamp DEFAULT_CLIENT_TIME_TIMESTAMP = new Timestamp(164174122517L);
String DEFAULT_NETWORK_TYPE = "WLAN";
Long DEFAULT_LOCATION_ID = 33L;
Integer DEFAULT_AREA_CODE = 34;
Long DEFAULT_AREA_CODE = 34L;
Integer DEFAULT_PRIMARY_SCRAMBLING_CODE = 35;
Integer DEFAULT_TIMING_ADVANCE = 36;
String DEFAULT_TEXT = "DEFAULT_TEXT";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ private void mockResultSet() throws SQLException {
when(resultSet.getObject("kg_nr", Integer.class)).thenReturn(TestConstants.DEFAULT_KG_NR);
when(resultSet.getObject("gkz_sa", Integer.class)).thenReturn(TestConstants.DEFAULT_GKZ_SA);
when(resultSet.getObject("land_cover", Integer.class)).thenReturn(TestConstants.DEFAULT_LAND_COVER);
when(resultSet.getObject("cell_area_code", Integer.class)).thenReturn(TestConstants.DEFAULT_CELL_AREA_CODE);
when(resultSet.getObject("cell_area_code", Long.class)).thenReturn(TestConstants.DEFAULT_CELL_AREA_CODE);
when(resultSet.getObject("cell_location_id", Integer.class)).thenReturn(TestConstants.DEFAULT_CELL_LOCATION_ID);
when(resultSet.getObject("channel_number", Integer.class)).thenReturn(TestConstants.DEFAULT_CHANNEL_NUMBER);
when(resultSet.getObject("radio_band", Integer.class)).thenReturn(TestConstants.DEFAULT_RADIO_BAND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void getSignals_correctInvocation_SignalGraphItemDTOs() throws SQLException {
when(resultSet.getObject("signal_strength", Integer.class)).thenReturn(TestConstants.DEFAULT_SIGNAL_STRENGTH);
when(resultSet.getString("cat_technology")).thenReturn(TestConstants.DEFAULT_CAT_TECHNOLOGY);
when(resultSet.getObject("location_id", Long.class)).thenReturn(TestConstants.DEFAULT_LOCATION_ID);
when(resultSet.getObject("area_code", Integer.class)).thenReturn(TestConstants.DEFAULT_AREA_CODE);
when(resultSet.getObject("area_code", Long.class)).thenReturn(TestConstants.DEFAULT_AREA_CODE);
when(resultSet.getObject("primary_scrambling_code", Integer.class)).thenReturn(TestConstants.DEFAULT_PRIMARY_SCRAMBLING_CODE);
when(resultSet.getObject("channel_number", Integer.class)).thenReturn(TestConstants.DEFAULT_CHANNEL_NUMBER);
when(resultSet.getObject("timing_advance", Integer.class)).thenReturn(TestConstants.DEFAULT_TIMING_ADVANCE);
Expand Down

0 comments on commit 00c731b

Please sign in to comment.