From 00c731b668f9b499826f98963da7a34c8940cbc9 Mon Sep 17 00:00:00 2001 From: Thomas Schreiber Date: Wed, 21 Aug 2024 15:06:29 +0200 Subject: [PATCH] #1713 change area_code, location_id to LONG type --- .../java/at/rtr/rmbt/dto/OpenTestExportResult.java | 2 +- .../repository/impl/OpenTestExportRepositoryImpl.java | 2 +- .../repository/impl/RadioSignalRepositoryImpl.java | 2 +- .../java/at/rtr/rmbt/response/OpenTestExportDto.java | 2 +- .../java/at/rtr/rmbt/response/SignalGraphItemDTO.java | 10 +++++----- src/test/java/at/rtr/rmbt/TestConstants.java | 4 ++-- .../impl/OpenTestExportRepositoryImplTest.java | 2 +- .../repository/impl/RadioSignalRepositoryImplTest.java | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/at/rtr/rmbt/dto/OpenTestExportResult.java b/src/main/java/at/rtr/rmbt/dto/OpenTestExportResult.java index 89ca843..d89581e 100644 --- a/src/main/java/at/rtr/rmbt/dto/OpenTestExportResult.java +++ b/src/main/java/at/rtr/rmbt/dto/OpenTestExportResult.java @@ -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; diff --git a/src/main/java/at/rtr/rmbt/repository/impl/OpenTestExportRepositoryImpl.java b/src/main/java/at/rtr/rmbt/repository/impl/OpenTestExportRepositoryImpl.java index 414c879..459b3f9 100644 --- a/src/main/java/at/rtr/rmbt/repository/impl/OpenTestExportRepositoryImpl.java +++ b/src/main/java/at/rtr/rmbt/repository/impl/OpenTestExportRepositoryImpl.java @@ -351,7 +351,7 @@ public List 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)) diff --git a/src/main/java/at/rtr/rmbt/repository/impl/RadioSignalRepositoryImpl.java b/src/main/java/at/rtr/rmbt/repository/impl/RadioSignalRepositoryImpl.java index 13c3016..c6d5b73 100644 --- a/src/main/java/at/rtr/rmbt/repository/impl/RadioSignalRepositoryImpl.java +++ b/src/main/java/at/rtr/rmbt/repository/impl/RadioSignalRepositoryImpl.java @@ -161,7 +161,7 @@ public List 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)); diff --git a/src/main/java/at/rtr/rmbt/response/OpenTestExportDto.java b/src/main/java/at/rtr/rmbt/response/OpenTestExportDto.java index 27829ea..1a09eeb 100644 --- a/src/main/java/at/rtr/rmbt/response/OpenTestExportDto.java +++ b/src/main/java/at/rtr/rmbt/response/OpenTestExportDto.java @@ -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; diff --git a/src/main/java/at/rtr/rmbt/response/SignalGraphItemDTO.java b/src/main/java/at/rtr/rmbt/response/SignalGraphItemDTO.java index 580484d..9c9cef5 100644 --- a/src/main/java/at/rtr/rmbt/response/SignalGraphItemDTO.java +++ b/src/main/java/at/rtr/rmbt/response/SignalGraphItemDTO.java @@ -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; @@ -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; diff --git a/src/test/java/at/rtr/rmbt/TestConstants.java b/src/test/java/at/rtr/rmbt/TestConstants.java index 8d96f49..01cdd76 100644 --- a/src/test/java/at/rtr/rmbt/TestConstants.java +++ b/src/test/java/at/rtr/rmbt/TestConstants.java @@ -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; @@ -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"; diff --git a/src/test/java/at/rtr/rmbt/repository/impl/OpenTestExportRepositoryImplTest.java b/src/test/java/at/rtr/rmbt/repository/impl/OpenTestExportRepositoryImplTest.java index a5f5134..023d55d 100644 --- a/src/test/java/at/rtr/rmbt/repository/impl/OpenTestExportRepositoryImplTest.java +++ b/src/test/java/at/rtr/rmbt/repository/impl/OpenTestExportRepositoryImplTest.java @@ -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); diff --git a/src/test/java/at/rtr/rmbt/repository/impl/RadioSignalRepositoryImplTest.java b/src/test/java/at/rtr/rmbt/repository/impl/RadioSignalRepositoryImplTest.java index 60898ec..8f411e1 100644 --- a/src/test/java/at/rtr/rmbt/repository/impl/RadioSignalRepositoryImplTest.java +++ b/src/test/java/at/rtr/rmbt/repository/impl/RadioSignalRepositoryImplTest.java @@ -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);