Skip to content

Commit

Permalink
[plugin-web-app] Switch to use non-deprecated API to configire page l…
Browse files Browse the repository at this point in the history
…oad timeout (#2641)
  • Loading branch information
valfirst committed Apr 6, 2022
1 parent a4a1928 commit 98381dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 the original author or authors.
* Copyright 2019-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,7 +42,7 @@ public void configure(Timeouts timeouts)

public void configurePageLoadTimeout(Duration duration, Timeouts timeouts)
{
setTimeout(timeouts, t -> t.pageLoadTimeout(duration.getSeconds(), TimeUnit.SECONDS));
setTimeout(timeouts, t -> t.pageLoadTimeout(duration));
}

private static void setTimeout(Timeouts timeouts, Consumer<Timeouts> consumer)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 the original author or authors.
* Copyright 2019-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -64,7 +64,7 @@ void testSetPageLoadTimeout()
{
Timeouts timeouts = mock(Timeouts.class);
timeoutConfigurer.configurePageLoadTimeout(DURATION_PAGE_LOAD_TIMEOUT, timeouts);
verify(timeouts).pageLoadTimeout(DURATION_PAGE_LOAD_TIMEOUT.getSeconds(), TimeUnit.SECONDS);
verify(timeouts).pageLoadTimeout(DURATION_PAGE_LOAD_TIMEOUT);
}

@Test
Expand Down

0 comments on commit 98381dc

Please sign in to comment.