@Test(expected = IllegalArgumentException.class) public void willThrowAnExceptionWhenTryingToGetLatestVersionMapForInvalidContext() { DriverMap driverMap = new DriverMap(); driverMap.getDetailsForLatestVersionOfDriverContext(binaryDataFor(OSX, GOOGLECHROME, ARCHITECTURE_64_BIT)); }
public DriverDetails getDetailsForLatestVersionOfDriverContext(DriverContext driverContext) { if (!repository.containsKey(driverContext)) { throw new IllegalArgumentException("Driver context not found in driver repository"); } TreeMap<String, DriverDetails> driverVersions = repository.get(driverContext); return driverVersions.get(driverVersions.lastKey()); }
DriverMap { public DriverDetails getDetailsForLatestVersionOfDriverContext(DriverContext driverContext) { if (!repository.containsKey(driverContext)) { throw new IllegalArgumentException("Driver context not found in driver repository"); } TreeMap<String, DriverDetails> driverVersions = repository.get(driverContext); return driverVersions.get(driverVersions.lastKey()); } }
DriverMap { public DriverDetails getDetailsForLatestVersionOfDriverContext(DriverContext driverContext) { if (!repository.containsKey(driverContext)) { throw new IllegalArgumentException("Driver context not found in driver repository"); } TreeMap<String, DriverDetails> driverVersions = repository.get(driverContext); return driverVersions.get(driverVersions.lastKey()); }  }
DriverMap { public DriverDetails getDetailsForLatestVersionOfDriverContext(DriverContext driverContext) { if (!repository.containsKey(driverContext)) { throw new IllegalArgumentException("Driver context not found in driver repository"); } TreeMap<String, DriverDetails> driverVersions = repository.get(driverContext); return driverVersions.get(driverVersions.lastKey()); }  TreeMap<String, DriverDetails> getMapForDriverContext(DriverContext driverContext); DriverDetails getDetailsForVersionOfDriverContext(DriverContext driverContext, String version); DriverDetails getDetailsForLatestVersionOfDriverContext(DriverContext driverContext); Set<DriverContext> getKeys(); Set<String> getAvailableVersionsForDriverContext(DriverContext driverContext); ArrayList<DriverContext> getDriverContextsForOperatingSystem(OperatingSystem operatingSystem, SystemArchitecture systemArchitecture); ArrayList<DriverContext> getDriverContextsForCurrentOperatingSystem(); }
DriverMap { public DriverDetails getDetailsForLatestVersionOfDriverContext(DriverContext driverContext) { if (!repository.containsKey(driverContext)) { throw new IllegalArgumentException("Driver context not found in driver repository"); } TreeMap<String, DriverDetails> driverVersions = repository.get(driverContext); return driverVersions.get(driverVersions.lastKey()); }  TreeMap<String, DriverDetails> getMapForDriverContext(DriverContext driverContext); DriverDetails getDetailsForVersionOfDriverContext(DriverContext driverContext, String version); DriverDetails getDetailsForLatestVersionOfDriverContext(DriverContext driverContext); Set<DriverContext> getKeys(); Set<String> getAvailableVersionsForDriverContext(DriverContext driverContext); ArrayList<DriverContext> getDriverContextsForOperatingSystem(OperatingSystem operatingSystem, SystemArchitecture systemArchitecture); ArrayList<DriverContext> getDriverContextsForCurrentOperatingSystem();  }