diff --git a/api-lib-core/src/main/java/de/ozgcloud/apilib/common/command/grpc/GrpcOzgCloudCommandService.java b/api-lib-core/src/main/java/de/ozgcloud/apilib/common/command/grpc/GrpcOzgCloudCommandService.java index 5cacd3bb05c474ea2759363f2f1b8b49b8089ce3..7c8c8c37491a50d3cdca67cc21c0b833957e252d 100644 --- a/api-lib-core/src/main/java/de/ozgcloud/apilib/common/command/grpc/GrpcOzgCloudCommandService.java +++ b/api-lib-core/src/main/java/de/ozgcloud/apilib/common/command/grpc/GrpcOzgCloudCommandService.java @@ -76,7 +76,7 @@ public class GrpcOzgCloudCommandService implements OzgCloudCommandService { return response.getCommandList().stream().map(mapper::fromGrpc).toList(); } - public boolean hasPendingCommands(OzgCloudVorgangId vorgangId) { + public boolean existsPendingCommands(OzgCloudVorgangId vorgangId) { var response = getCommandServiceStub().existsPendingCommands(buildHasPendingCommandRequest(vorgangId)); return response.getExistsPendingCommands(); } diff --git a/api-lib-core/src/test/java/de/ozgcloud/apilib/common/command/grpc/GrpcOzgCloudCommandServiceTest.java b/api-lib-core/src/test/java/de/ozgcloud/apilib/common/command/grpc/GrpcOzgCloudCommandServiceTest.java index 03b06ebcacc7c319974a509b9f3641a000f04c83..281ae7aa8089973ac950df643464eeb34c13dd2f 100644 --- a/api-lib-core/src/test/java/de/ozgcloud/apilib/common/command/grpc/GrpcOzgCloudCommandServiceTest.java +++ b/api-lib-core/src/test/java/de/ozgcloud/apilib/common/command/grpc/GrpcOzgCloudCommandServiceTest.java @@ -207,7 +207,7 @@ class GrpcOzgCloudCommandServiceTest { } @Nested - class TestHasPendingCommands { + class TestExistsPendingCommands { private final GrpcExistsPendingCommandsRequest request = GrpcExistsPendingCommandsRequestTestFactory.create(); @@ -224,21 +224,21 @@ class GrpcOzgCloudCommandServiceTest { @Test void shouldCallBuildHasPendingCommandRequest() { - hasPendingCommands(); + existsPendingCommands(); verify(service).buildHasPendingCommandRequest(OzgCloudVorgangTestFactory.ID); } @Test void shouldCallGetCommandServiceStub() { - hasPendingCommands(); + existsPendingCommands(); verify(service).getCommandServiceStub(); } @Test void shouldCallServiceStubWithInterceptor() { - hasPendingCommands(); + existsPendingCommands(); verify(serviceStubWithInterceptor).existsPendingCommands(request); } @@ -249,13 +249,13 @@ class GrpcOzgCloudCommandServiceTest { var response = GrpcExistsPendingCommandsResponse.newBuilder().setExistsPendingCommands(hasPendingCommands).build(); when(serviceStubWithInterceptor.existsPendingCommands(any())).thenReturn(response); - var result = hasPendingCommands(); + var result = existsPendingCommands(); assertThat(result).isEqualTo(hasPendingCommands); } - private boolean hasPendingCommands() { - return service.hasPendingCommands(OzgCloudVorgangTestFactory.ID); + private boolean existsPendingCommands() { + return service.existsPendingCommands(OzgCloudVorgangTestFactory.ID); } }