|
1 | 1 | package net.mullvad.mullvadvpn.compose.data
|
2 | 2 |
|
3 |
| -import net.mullvad.mullvadvpn.model.CustomListName |
4 |
| -import net.mullvad.mullvadvpn.model.PortRange |
5 |
| -import net.mullvad.mullvadvpn.model.RelayEndpointData |
6 |
| -import net.mullvad.mullvadvpn.model.RelayList |
7 |
| -import net.mullvad.mullvadvpn.model.RelayListCity |
8 |
| -import net.mullvad.mullvadvpn.model.RelayListCountry |
9 |
| -import net.mullvad.mullvadvpn.model.WireguardEndpointData |
10 |
| -import net.mullvad.mullvadvpn.model.WireguardRelayEndpointData |
11 |
| -import net.mullvad.mullvadvpn.relaylist.RelayItem |
12 |
| -import net.mullvad.mullvadvpn.relaylist.toRelayCountries |
| 3 | +import net.mullvad.mullvadvpn.lib.model.CustomList |
| 4 | +import net.mullvad.mullvadvpn.lib.model.CustomListId |
| 5 | +import net.mullvad.mullvadvpn.lib.model.CustomListName |
| 6 | +import net.mullvad.mullvadvpn.lib.model.GeoLocationId |
| 7 | +import net.mullvad.mullvadvpn.lib.model.Ownership |
| 8 | +import net.mullvad.mullvadvpn.lib.model.PortRange |
| 9 | +import net.mullvad.mullvadvpn.lib.model.Provider |
| 10 | +import net.mullvad.mullvadvpn.lib.model.ProviderId |
| 11 | +import net.mullvad.mullvadvpn.lib.model.RelayItem |
| 12 | +import net.mullvad.mullvadvpn.lib.model.RelayList |
| 13 | +import net.mullvad.mullvadvpn.lib.model.WireguardEndpointData |
13 | 14 |
|
14 | 15 | private val DUMMY_RELAY_1 =
|
15 |
| - net.mullvad.mullvadvpn.model.Relay( |
16 |
| - hostname = "Relay host 1", |
| 16 | + RelayItem.Location.Relay( |
| 17 | + id = |
| 18 | + GeoLocationId.Hostname( |
| 19 | + city = GeoLocationId.City(GeoLocationId.Country("RCo1"), "Relay City 1"), |
| 20 | + "Relay host 1" |
| 21 | + ), |
17 | 22 | active = true,
|
18 |
| - endpointData = RelayEndpointData.Wireguard(WireguardRelayEndpointData), |
19 |
| - owned = true, |
20 |
| - provider = "PROVIDER" |
| 23 | + provider = |
| 24 | + Provider( |
| 25 | + providerId = ProviderId("PROVIDER RENTED"), |
| 26 | + ownership = Ownership.Rented, |
| 27 | + ) |
21 | 28 | )
|
22 | 29 | private val DUMMY_RELAY_2 =
|
23 |
| - net.mullvad.mullvadvpn.model.Relay( |
24 |
| - hostname = "Relay host 2", |
| 30 | + RelayItem.Location.Relay( |
| 31 | + id = |
| 32 | + GeoLocationId.Hostname( |
| 33 | + city = GeoLocationId.City(GeoLocationId.Country("RCo2"), "Relay City 2"), |
| 34 | + "Relay host 2" |
| 35 | + ), |
25 | 36 | active = true,
|
26 |
| - endpointData = RelayEndpointData.Wireguard(WireguardRelayEndpointData), |
27 |
| - owned = true, |
28 |
| - provider = "PROVIDER" |
| 37 | + provider = |
| 38 | + Provider(providerId = ProviderId("PROVIDER OWNED"), ownership = Ownership.MullvadOwned) |
| 39 | + ) |
| 40 | +private val DUMMY_RELAY_CITY_1 = |
| 41 | + RelayItem.Location.City( |
| 42 | + name = "Relay City 1", |
| 43 | + id = GeoLocationId.City(countryCode = GeoLocationId.Country("RCo1"), cityCode = "RCi1"), |
| 44 | + relays = listOf(DUMMY_RELAY_1), |
| 45 | + expanded = false |
| 46 | + ) |
| 47 | +private val DUMMY_RELAY_CITY_2 = |
| 48 | + RelayItem.Location.City( |
| 49 | + name = "Relay City 2", |
| 50 | + id = GeoLocationId.City(countryCode = GeoLocationId.Country("RCo2"), cityCode = "RCi2"), |
| 51 | + relays = listOf(DUMMY_RELAY_2), |
| 52 | + expanded = false |
29 | 53 | )
|
30 |
| -private val DUMMY_RELAY_CITY_1 = RelayListCity("Relay City 1", "RCi1", arrayListOf(DUMMY_RELAY_1)) |
31 |
| -private val DUMMY_RELAY_CITY_2 = RelayListCity("Relay City 2", "RCi2", arrayListOf(DUMMY_RELAY_2)) |
32 | 54 | private val DUMMY_RELAY_COUNTRY_1 =
|
33 |
| - RelayListCountry("Relay Country 1", "RCo1", arrayListOf(DUMMY_RELAY_CITY_1)) |
| 55 | + RelayItem.Location.Country( |
| 56 | + name = "Relay Country 1", |
| 57 | + id = GeoLocationId.Country("RCo1"), |
| 58 | + expanded = false, |
| 59 | + cities = listOf(DUMMY_RELAY_CITY_1) |
| 60 | + ) |
34 | 61 | private val DUMMY_RELAY_COUNTRY_2 =
|
35 |
| - RelayListCountry("Relay Country 2", "RCo2", arrayListOf(DUMMY_RELAY_CITY_2)) |
| 62 | + RelayItem.Location.Country( |
| 63 | + name = "Relay Country 2", |
| 64 | + id = GeoLocationId.Country("RCo2"), |
| 65 | + expanded = false, |
| 66 | + cities = listOf(DUMMY_RELAY_CITY_2) |
| 67 | + ) |
36 | 68 |
|
37 | 69 | private val DUMMY_WIREGUARD_PORT_RANGES = ArrayList<PortRange>()
|
38 | 70 | private val DUMMY_WIREGUARD_ENDPOINT_DATA = WireguardEndpointData(DUMMY_WIREGUARD_PORT_RANGES)
|
39 | 71 |
|
40 |
| -val DUMMY_RELAY_COUNTRIES = |
| 72 | +val DUMMY_RELAY_COUNTRIES = listOf(DUMMY_RELAY_COUNTRY_1, DUMMY_RELAY_COUNTRY_2) |
| 73 | + |
| 74 | +val DUMMY_RELAY_LIST = |
41 | 75 | RelayList(
|
42 |
| - arrayListOf(DUMMY_RELAY_COUNTRY_1, DUMMY_RELAY_COUNTRY_2), |
43 |
| - DUMMY_WIREGUARD_ENDPOINT_DATA, |
44 |
| - ) |
45 |
| - .toRelayCountries() |
| 76 | + DUMMY_RELAY_COUNTRIES, |
| 77 | + DUMMY_WIREGUARD_ENDPOINT_DATA, |
| 78 | + ) |
46 | 79 |
|
47 |
| -val DUMMY_CUSTOM_LISTS = |
| 80 | +val DUMMY_RELAY_ITEM_CUSTOM_LISTS = |
48 | 81 | listOf(
|
49 | 82 | RelayItem.CustomList(
|
50 |
| - CustomListName.fromString("First list"), |
51 |
| - false, |
52 |
| - "1", |
| 83 | + customListName = CustomListName.fromString("First list"), |
| 84 | + expanded = false, |
| 85 | + id = CustomListId("1"), |
53 | 86 | locations = DUMMY_RELAY_COUNTRIES
|
54 | 87 | ),
|
55 | 88 | RelayItem.CustomList(
|
56 |
| - CustomListName.fromString("Empty list"), |
| 89 | + customListName = CustomListName.fromString("Empty list"), |
57 | 90 | expanded = false,
|
58 |
| - "2", |
| 91 | + id = CustomListId("2"), |
| 92 | + locations = emptyList() |
| 93 | + ) |
| 94 | + ) |
| 95 | + |
| 96 | +val DUMMY_CUSTOM_LISTS = |
| 97 | + listOf( |
| 98 | + CustomList( |
| 99 | + name = CustomListName.fromString("First list"), |
| 100 | + id = CustomListId("1"), |
| 101 | + locations = DUMMY_RELAY_COUNTRIES.map { it.id } |
| 102 | + ), |
| 103 | + CustomList( |
| 104 | + name = CustomListName.fromString("Empty list"), |
| 105 | + id = CustomListId("2"), |
59 | 106 | locations = emptyList()
|
60 | 107 | )
|
61 | 108 | )
|
0 commit comments