@VisibleForTesting
  int getReturnCode() {

    int successCode = CommandExecutorCodes.Kitchen.SUCCESS.getCode();

    if ( getResult().getNrErrors() != 0 ) {
      getLog().logError( BaseMessages.getString( getPkgClazz(), "Kitchen.Error.FinishedWithErrors" ) );
      return CommandExecutorCodes.Kitchen.ERRORS_DURING_PROCESSING.getCode();
    }

    return getResult().getResult() ? successCode : CommandExecutorCodes.Kitchen.ERRORS_DURING_PROCESSING.getCode();

  }
@Test
  public void testReturnCodeWithErrors() {
    try ( MockedStatic<BaseMessages> baseMessagesMockedStatic = mockStatic( BaseMessages.class ) ) {
      baseMessagesMockedStatic.when( () -> BaseMessages.getString( any(), anyString() ) ).thenReturn( "" );
      when( result.getNrErrors() ).thenReturn( 1L );
      when( mockedKitchenCommandExecutor.getResult() ).thenReturn( result );
      when( mockedKitchenCommandExecutor.getLog() ).thenReturn( logChannelInterface );
      assertEquals( mockedKitchenCommandExecutor.getReturnCode(),
        CommandExecutorCodes.Kitchen.ERRORS_DURING_PROCESSING.getCode() );
    }
  }