Skip to content

Commit

Permalink
Apply formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
bresciamattia authored and github-actions[bot] committed May 13, 2024
1 parent 0d484fc commit 900e1ff
Showing 1 changed file with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
/*
* Copyright © 2017-2024 factcast.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.factcast.client.grpc;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

import io.grpc.Channel;
import org.factcast.grpc.api.gen.RemoteFactStoreGrpc;
import org.junit.jupiter.api.Test;
Expand All @@ -8,21 +26,18 @@
import org.mockito.MockedStatic;
import org.mockito.junit.jupiter.MockitoExtension;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

@ExtendWith(MockitoExtension.class)
class FactCastGrpcStubsFactoryImplTest {

@Mock
Channel channel;
@Mock Channel channel;

final FactCastGrpcStubsFactory uut = new FactCastGrpcStubsFactoryImpl();

@Test
public void createsBlockingStub() {
try (MockedStatic<RemoteFactStoreGrpc> mock = mockStatic(RemoteFactStoreGrpc.class)) {
RemoteFactStoreGrpc.RemoteFactStoreBlockingStub stub = mock(RemoteFactStoreGrpc.RemoteFactStoreBlockingStub.class);
RemoteFactStoreGrpc.RemoteFactStoreBlockingStub stub =
mock(RemoteFactStoreGrpc.RemoteFactStoreBlockingStub.class);
mock.when(() -> RemoteFactStoreGrpc.newBlockingStub(channel)).thenReturn(stub);
assertEquals(stub, uut.createBlockingStub(channel));
}
Expand All @@ -31,9 +46,10 @@ public void createsBlockingStub() {
@Test
public void createsStub() {
try (MockedStatic<RemoteFactStoreGrpc> mock = mockStatic(RemoteFactStoreGrpc.class)) {
RemoteFactStoreGrpc.RemoteFactStoreStub stub = mock(RemoteFactStoreGrpc.RemoteFactStoreStub.class);
RemoteFactStoreGrpc.RemoteFactStoreStub stub =
mock(RemoteFactStoreGrpc.RemoteFactStoreStub.class);
mock.when(() -> RemoteFactStoreGrpc.newStub(channel)).thenReturn(stub);
assertEquals(stub, uut.createStub(channel));
}
}
}
}

0 comments on commit 900e1ff

Please sign in to comment.