Skip to content

Commit 589a440

Browse files
author
innokenty
committed
Revert "add getHosts method to Browsers bean"
This reverts commit acdbc06.
1 parent 0cf393a commit 589a440

File tree

2 files changed

+10
-25
lines changed

2 files changed

+10
-25
lines changed

config/src/main/java/ru/qatools/gridrouter/config/WithHosts.java

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
package ru.qatools.gridrouter.config;
22

33
import java.util.HashMap;
4+
import java.util.List;
45
import java.util.Map;
56

67
/**
78
* @author Dmitry Baev [email protected]
89
* @author Innokenty Shuvalov [email protected]
910
*/
10-
public interface WithRoutesMap extends WithHosts {
11+
public interface WithRoutesMap {
12+
13+
List<Browser> getBrowsers();
1114

1215
default Map<String, String> getRoutesMap() {
13-
Map<String, String> routes = new HashMap<>();
14-
getHosts().forEach(h -> routes.put(h.getRouteId(), h.getRoute()));
16+
HashMap<String, String> routes = new HashMap<>();
17+
getBrowsers().stream()
18+
.flatMap(b -> b.getVersions().stream())
19+
.flatMap(v -> v.getRegions().stream())
20+
.flatMap(r -> r.getHosts().stream())
21+
.forEach(h -> routes.put(h.getRouteId(), h.getRoute()));
1522
return routes;
1623
}
1724
}

0 commit comments

Comments
 (0)