Changing Traffic Router to point to Traffic Ops api version 5.0 (#7757)

* Changing Traffic Router to point to Traffic Ops api version 5.0

* add changelog

* fix tests
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a435a14..a66862c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -50,6 +50,7 @@
 - [#7652](https://github.com/apache/trafficcontrol/pull/7652) *t3c* added rpmdb checks and use package data from t3c-apply-metadata.json if rpmdb is corrupt.
 
 ### Changed
+- [#7757](https://github.com/apache/trafficcontrol/pull/7757) *Traffic Router* Changed Traffic Router to point to api version 5.0 of Traffic Ops.
 - [#7732](https://github.com/apache/trafficcontrol/pull/7732) *Traffic Router* Increased negative TTL value to 900 seconds.
 - [#7584](https://github.com/apache/trafficcontrol/pull/7584) *Documentation* Upgrade Traffic Control Sphinx documentation Makefile OS intelligent.
 - [#7521](https://github.com/apache/trafficcontrol/pull/7521) *Traffic Ops* Returns empty array instead of null when no permissions are given for roles endpoint using POST or PUT request.
diff --git a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/TrafficOpsUtils.java b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/TrafficOpsUtils.java
index b828386..9cf191b 100644
--- a/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/TrafficOpsUtils.java
+++ b/traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/util/TrafficOpsUtils.java
@@ -23,7 +23,7 @@
 import java.util.Map;
 
 public class TrafficOpsUtils {
-	public static final String TO_API_VERSION = "4.0";
+	public static final String TO_API_VERSION = "5.0";
 
 	private String username;
 	private String password;
diff --git a/traffic_router/core/src/test/resources/api/4.0/cdns/name/thecdn/sslkeys b/traffic_router/core/src/test/resources/api/5.0/cdns/name/thecdn/sslkeys
similarity index 100%
rename from traffic_router/core/src/test/resources/api/4.0/cdns/name/thecdn/sslkeys
rename to traffic_router/core/src/test/resources/api/5.0/cdns/name/thecdn/sslkeys
diff --git a/traffic_router/core/src/test/resources/api/4.0/cdns/name/thecdn/sslkeys-missing-1 b/traffic_router/core/src/test/resources/api/5.0/cdns/name/thecdn/sslkeys-missing-1
similarity index 100%
rename from traffic_router/core/src/test/resources/api/4.0/cdns/name/thecdn/sslkeys-missing-1
rename to traffic_router/core/src/test/resources/api/5.0/cdns/name/thecdn/sslkeys-missing-1
diff --git a/traffic_router/core/src/test/resources/api/4.0/federations/all b/traffic_router/core/src/test/resources/api/5.0/federations/all
similarity index 100%
rename from traffic_router/core/src/test/resources/api/4.0/federations/all
rename to traffic_router/core/src/test/resources/api/5.0/federations/all
diff --git a/traffic_router/core/src/test/resources/api/4.0/steering b/traffic_router/core/src/test/resources/api/5.0/steering
similarity index 100%
rename from traffic_router/core/src/test/resources/api/4.0/steering
rename to traffic_router/core/src/test/resources/api/5.0/steering
diff --git a/traffic_router/core/src/test/resources/api/4.0/steering2 b/traffic_router/core/src/test/resources/api/5.0/steering2
similarity index 100%
rename from traffic_router/core/src/test/resources/api/4.0/steering2
rename to traffic_router/core/src/test/resources/api/5.0/steering2
diff --git a/traffic_router/core/src/test/resources/publish/CrConfig.json b/traffic_router/core/src/test/resources/publish/CrConfig.json
index b327d38..648d360 100644
--- a/traffic_router/core/src/test/resources/publish/CrConfig.json
+++ b/traffic_router/core/src/test/resources/publish/CrConfig.json
@@ -1916,12 +1916,12 @@
     }
   },
   "config": {
-    "certificate.api.url": "http://${toHostname}/api/4.0/cdns/name/${cdnName}/sslkeys",
-    "dnschallengemapping.polling.url": "http://${toHostname}/api/4.0/dnsrecords/",
+    "certificate.api.url": "http://${toHostname}/api/5.0/cdns/name/${cdnName}/sslkeys",
+    "dnschallengemapping.polling.url": "http://${toHostname}/api/5.0/dnsrecords/",
     "dnschallengemapping.polling.interval": "600000",
-    "federationmapping.polling.url": "http://${toHostname}/api/4.0/federations/all",
+    "federationmapping.polling.url": "http://${toHostname}/api/5.0/federations/all",
     "federationmapping.polling.interval": "600000",
-    "steeringmapping.polling.url": "http://${toHostname}/api/4.0/steering",
+    "steeringmapping.polling.url": "http://${toHostname}/api/5.0/steering",
     "steeringmapping.polling.interval": "15000",
     "weight": "1.0",
     "requestHeaders": [
@@ -1940,7 +1940,7 @@
     },
     "coveragezone.polling.interval": "86400000",
     "regional_geoblock.polling.url.renamed": "http://testing-tm-01.cdn.example.com/some/path",
-    "keystore.auth.url": "http://localhost:3000/api/4.0/user/login",
+    "keystore.auth.url": "http://localhost:3000/api/5.0/user/login",
     "neustar.polling.interval": "12800000",
     "geolocation6.polling.interval": "86400000",
     "domain_name": "thecdn.example.com",
@@ -1954,7 +1954,7 @@
     },
     "coveragezone.polling.url": "http://localhost:8889/czf.json",
     "deepcoveragezone.polling.url": "http://localhost:8889/dczmap.json",
-    "api.auth.url": "http://${toHostname}/api/4.0/user/login",
+    "api.auth.url": "http://${toHostname}/api/5.0/user/login",
     "certificates.polling.interval": "10000",
     "dnssec.enabled": "false",
     "edge.dns.routing": "true",
diff --git a/traffic_router/core/src/test/resources/publish/CrConfig2.json b/traffic_router/core/src/test/resources/publish/CrConfig2.json
index 0a1e7dc..695ba58 100644
--- a/traffic_router/core/src/test/resources/publish/CrConfig2.json
+++ b/traffic_router/core/src/test/resources/publish/CrConfig2.json
@@ -1210,12 +1210,12 @@
     }
   },
   "config": {
-    "certificate.api.url": "http://${toHostname}/api/4.0/cdns/name/${cdnName}/sslkeys",
-    "dnschallengemapping.polling.url": "http://${toHostname}/api/4.0/dnsrecords/",
+    "certificate.api.url": "http://${toHostname}/api/5.0/cdns/name/${cdnName}/sslkeys",
+    "dnschallengemapping.polling.url": "http://${toHostname}/api/5.0/dnsrecords/",
     "dnschallengemapping.polling.interval": "600000",
-    "federationmapping.polling.url": "http://${toHostname}/api/4.0/federations/all",
+    "federationmapping.polling.url": "http://${toHostname}/api/5.0/federations/all",
     "federationmapping.polling.interval": "600000",
-    "steeringmapping.polling.url": "http://${toHostname}/api/4.0/steering",
+    "steeringmapping.polling.url": "http://${toHostname}/api/5.0/steering",
     "steeringmapping.polling.interval": "15000",
     "weight": "1.0",
     "requestHeaders": [
@@ -1234,7 +1234,7 @@
     },
     "coveragezone.polling.interval": "86400000",
     "regional_geoblock.polling.url.renamed": "http://testing-tm-01.cdn.example.com/some/path",
-    "keystore.auth.url": "http://localhost:3000/api/4.0/user/login",
+    "keystore.auth.url": "http://localhost:3000/api/5.0/user/login",
     "neustar.polling.interval": "12800000",
     "geolocation6.polling.interval": "86400000",
     "domain_name": "thecdn.example.com",
@@ -1247,7 +1247,7 @@
       "refresh": "28800"
     },
     "coveragezone.polling.url": "http://localhost:8889/czf.json",
-    "api.auth.url": "http://${toHostname}/api/4.0/user/login",
+    "api.auth.url": "http://${toHostname}/api/5.0/user/login",
     "certificates.polling.interval": "10000",
     "dnssec.enabled": "false"
   }
diff --git a/traffic_router/core/src/test/resources/publish/CrConfig3.json b/traffic_router/core/src/test/resources/publish/CrConfig3.json
index dfd3850..c7ef31d 100644
--- a/traffic_router/core/src/test/resources/publish/CrConfig3.json
+++ b/traffic_router/core/src/test/resources/publish/CrConfig3.json
@@ -1210,12 +1210,12 @@
     }
   },
   "config": {
-    "certificate.api.url": "http://${toHostname}/api/4.0/cdns/name/${cdnName}/sslkeys",
-    "dnschallengemapping.polling.url": "http://${toHostname}/api/4.0/dnsrecords/",
+    "certificate.api.url": "http://${toHostname}/api/5.0/cdns/name/${cdnName}/sslkeys",
+    "dnschallengemapping.polling.url": "http://${toHostname}/api/5.0/dnsrecords/",
     "dnschallengemapping.polling.interval": "600000",
-    "federationmapping.polling.url": "http://${toHostname}/api/4.0/federations/all",
+    "federationmapping.polling.url": "http://${toHostname}/api/5.0/federations/all",
     "federationmapping.polling.interval": "600000",
-    "steeringmapping.polling.url": "http://${toHostname}/api/4.0/steering",
+    "steeringmapping.polling.url": "http://${toHostname}/api/5.0/steering",
     "steeringmapping.polling.interval": "15000",
     "weight": "1.0",
     "requestHeaders": [
@@ -1234,7 +1234,7 @@
     },
     "coveragezone.polling.interval": "86400000",
     "regional_geoblock.polling.url.renamed": "http://testing-tm-01.cdn.example.com/some/path",
-    "keystore.auth.url": "http://localhost:3000/api/4.0/user/login",
+    "keystore.auth.url": "http://localhost:3000/api/5.0/user/login",
     "neustar.polling.interval": "12800000",
     "geolocation6.polling.interval": "86400000",
     "domain_name": "thecdn.example.com",
@@ -1247,7 +1247,7 @@
       "refresh": "28800"
     },
     "coveragezone.polling.url": "http://localhost:8889/czf.json",
-    "api.auth.url": "http://${toHostname}/api/4.0/user/login",
+    "api.auth.url": "http://${toHostname}/api/5.0/user/login",
     "certificates.polling.interval": "10000",
     "dnssec.enabled": "false"
   }
diff --git a/traffic_router/core/src/test/resources/publish/CrConfig4.json b/traffic_router/core/src/test/resources/publish/CrConfig4.json
index b656dd7..afe74a6 100644
--- a/traffic_router/core/src/test/resources/publish/CrConfig4.json
+++ b/traffic_router/core/src/test/resources/publish/CrConfig4.json
@@ -1255,12 +1255,12 @@
     }
   },
   "config": {
-    "certificate.api.url": "http://${toHostname}/api/4.0/cdns/name/${cdnName}/sslkeys",
-    "dnschallengemapping.polling.url": "http://${toHostname}/api/4.0/dnsrecords/",
+    "certificate.api.url": "http://${toHostname}/api/5.0/cdns/name/${cdnName}/sslkeys",
+    "dnschallengemapping.polling.url": "http://${toHostname}/api/5.0/dnsrecords/",
     "dnschallengemapping.polling.interval": "600000",
-    "federationmapping.polling.url": "http://${toHostname}/api/4.0/federations/all",
+    "federationmapping.polling.url": "http://${toHostname}/api/5.0/federations/all",
     "federationmapping.polling.interval": "600000",
-    "steeringmapping.polling.url": "http://${toHostname}/api/4.0/steering",
+    "steeringmapping.polling.url": "http://${toHostname}/api/5.0/steering",
     "steeringmapping.polling.interval": "15000",
     "weight": "1.0",
     "requestHeaders": [
@@ -1279,7 +1279,7 @@
     },
     "coveragezone.polling.interval": "86400000",
     "regional_geoblock.polling.url.renamed": "http://testing-tm-01.cdn.example.com/some/path",
-    "keystore.auth.url": "http://localhost:3000/api/4.0/user/login",
+    "keystore.auth.url": "http://localhost:3000/api/5.0/user/login",
     "neustar.polling.interval": "12800000",
     "geolocation6.polling.interval": "86400000",
     "domain_name": "thecdn.example.com",
@@ -1292,7 +1292,7 @@
       "refresh": "28800"
     },
     "coveragezone.polling.url": "http://localhost:8889/czf.json",
-    "api.auth.url": "http://${toHostname}/api/4.0/user/login",
+    "api.auth.url": "http://${toHostname}/api/5.0/user/login",
     "certificates.polling.interval": "10000",
     "dnssec.enabled": "false"
   }