1616
1717package  io .fabric8 .kubernetes .client .dsl .internal ;
1818
19- import  static  org .assertj .core .api .Assertions .assertThat ;
20- import  static  org .mockito .Mockito .mock ;
21- import  static  org .mockito .Mockito .spy ;
22- import  static  org .mockito .Mockito .when ;
19+ import  io .fabric8 .kubernetes .client .http .AsyncBody ;
20+ import  io .fabric8 .kubernetes .client .http .HttpClient ;
21+ import  io .fabric8 .kubernetes .client .http .HttpRequest ;
22+ import  io .fabric8 .kubernetes .client .http .HttpResponse ;
23+ import  io .fabric8 .kubernetes .client .http .TestAsyncBody ;
24+ import  io .fabric8 .kubernetes .client .http .TestHttpResponse ;
25+ import  io .fabric8 .kubernetes .client .impl .BaseClient ;
26+ import  io .fabric8 .kubernetes .client .utils .KubernetesSerialization ;
27+ import  org .junit .jupiter .api .BeforeEach ;
28+ import  org .junit .jupiter .api .Test ;
29+ import  org .mockito .Mockito ;
2330
2431import  java .io .ByteArrayOutputStream ;
2532import  java .net .HttpURLConnection ;
3138import  java .util .concurrent .Executors ;
3239import  java .util .concurrent .TimeUnit ;
3340
34- import  org .junit .jupiter .api .BeforeEach ;
35- import  org .junit .jupiter .api .Test ;
36- import  org .mockito .Mockito ;
37- 
38- import  io .fabric8 .kubernetes .client .http .AsyncBody ;
39- import  io .fabric8 .kubernetes .client .http .HttpClient ;
40- import  io .fabric8 .kubernetes .client .http .HttpRequest ;
41- import  io .fabric8 .kubernetes .client .http .HttpResponse ;
42- import  io .fabric8 .kubernetes .client .http .TestAsyncBody ;
43- import  io .fabric8 .kubernetes .client .http .TestHttpResponse ;
44- import  io .fabric8 .kubernetes .client .impl .BaseClient ;
45- import  io .fabric8 .kubernetes .client .utils .KubernetesSerialization ;
41+ import  static  org .assertj .core .api .Assertions .assertThat ;
42+ import  static  org .mockito .Mockito .mock ;
43+ import  static  org .mockito .Mockito .spy ;
44+ import  static  org .mockito .Mockito .when ;
4645
47- public   class  LogWatchCallbackTest  {
46+ class  LogWatchCallbackTest  {
4847  private  OperationContext  context ;
4948  private  Executor  executor  = Executors .newFixedThreadPool (2 );
5049  private  URL  url ;
5150  private  HttpClient  httpClientMock ;
5251
5352  @ BeforeEach 
54-   public   void  setUp () throws  MalformedURLException  {
53+   void  setUp () throws  MalformedURLException  {
5554    BaseClient  mock  = mock (BaseClient .class , Mockito .RETURNS_SELF );
5655    Mockito .when (mock .adapt (BaseClient .class ).getKubernetesSerialization ()).thenReturn (new  KubernetesSerialization ());
57-     final  OperationContext  context  = new  OperationContext ().withClient (mock );
56+     final  OperationContext  operationContext  = new  OperationContext ().withClient (mock );
5857    when (mock .getExecutor ()).thenReturn (this .executor );
59-     this .context  = context ;
58+     this .context  = operationContext ;
6059
6160    this .url  = new  URL ("http://url_called" );
6261    this .httpClientMock  = spy (HttpClient .class );
@@ -70,7 +69,7 @@ public void setUp() throws MalformedURLException {
7069  }
7170
7271  @ Test 
73-   public   void  withOutputStreamCloseEventTest () throws  InterruptedException  {
72+   void  withOutputStreamCloseEventTest () throws  InterruptedException  {
7473
7574    var  future  = new  CompletableFuture <HttpResponse <AsyncBody >>();
7675    var  reached  = new  CountDownLatch (1 );
@@ -92,7 +91,7 @@ public void withOutputStreamCloseEventTest() throws InterruptedException {
9291  }
9392
9493  @ Test 
95-   public   void  withOutputStreamCloseEventOnFailureTest () throws   MalformedURLException ,  InterruptedException  {
94+   void  withOutputStreamCloseEventOnFailureTest () throws  InterruptedException  {
9695
9796    var  future  = new  CompletableFuture <HttpResponse <AsyncBody >>();
9897    var  reached  = new  CountDownLatch (1 );
@@ -102,12 +101,12 @@ public void withOutputStreamCloseEventOnFailureTest() throws MalformedURLExcepti
102101    LogWatchCallback  logWatch  = new  LogWatchCallback (new  ByteArrayOutputStream (), this .context );
103102    logWatch .callAndWait (httpClientMock , url );
104103
105-     final  Throwable   tReturned []  = new  Throwable [1 ];
104+     final  Throwable []  tReturned  = new  Throwable [1 ];
106105    logWatch .onClose ().thenAccept ((Throwable  t ) -> {
107106      tReturned [0 ] = t ;
108107      reached .countDown ();
109108    });
110-     
109+ 
111110    var  th  = new  Throwable ("any exception" );
112111    future .completeExceptionally (th );
113112
0 commit comments