11package com .github .dockerjava .cmd ;
22
3+ import com .github .dockerjava .api .async .ResultCallbackTemplate ;
34import com .github .dockerjava .api .command .CreateContainerResponse ;
45import com .github .dockerjava .api .model .Statistics ;
5- import com .github .dockerjava .core .async .ResultCallbackTemplate ;
66import org .junit .Test ;
77import org .slf4j .Logger ;
88import org .slf4j .LoggerFactory ;
@@ -28,8 +28,10 @@ public void testStatsStreaming() throws InterruptedException, IOException {
2828 dockerRule .getClient ().startContainerCmd (container .getId ()).exec ();
2929
3030 boolean gotStats = false ;
31- try (StatsCallbackTest statsCallback = dockerRule .getClient ().statsCmd (container .getId ()).exec (
32- new StatsCallbackTest (countDownLatch ))) {
31+ try (StatsCallbackTest statsCallback = dockerRule .getClient ()
32+ .statsCmd (container .getId ())
33+ .exec (new StatsCallbackTest (countDownLatch ))) {
34+
3335 assertTrue (countDownLatch .await (10 , TimeUnit .SECONDS ));
3436 gotStats = statsCallback .gotStats ();
3537
@@ -53,7 +55,7 @@ public void testStatsNoStreaming() throws InterruptedException, IOException {
5355 dockerRule .getClient ().startContainerCmd (container .getId ()).exec ();
5456
5557 try (StatsCallbackTest statsCallback = dockerRule .getClient ().statsCmd (container .getId ()).withNoStream (true ).exec (
56- new StatsCallbackTest (countDownLatch ))) {
58+ new StatsCallbackTest (countDownLatch ))) {
5759 countDownLatch .await (5 , TimeUnit .SECONDS );
5860
5961 LOG .info ("Stop stats collection" );
@@ -67,7 +69,7 @@ public void testStatsNoStreaming() throws InterruptedException, IOException {
6769 assertEquals ("Expected stats called only once" , countDownLatch .getCount (), NUM_STATS - 1 );
6870 }
6971
70- private class StatsCallbackTest extends ResultCallbackTemplate <StatsCallbackTest , Statistics > {
72+ private static class StatsCallbackTest extends ResultCallbackTemplate <StatsCallbackTest , Statistics > {
7173 private final CountDownLatch countDownLatch ;
7274
7375 private Boolean gotStats = false ;
0 commit comments