[PR #266] [MERGED] [265] Add file upload to allow mocking of file operations #832

Closed
opened 2025-12-29 08:33:42 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/wiremock/WireMock.Net/pull/266
Author: @JackCreativeCrew
Created: 4/8/2019
Status: Merged
Merged: 4/11/2019
Merged by: @StefH

Base: masterHead: 265-file-upload


📝 Commits (10+)

  • 501b4f2 [265] Add file upload to allow mocking of file operations
  • df62498 [265] Fix failing test
  • dba0f7c Merge branch 'master' into 265-file-upload
  • c5ad05b Update code + add tests
  • be4aa88 LocalFileSystemHandlerTests
  • f2cae2c 1.0.13
  • 30ce475 Fixed the file post to create the mapping folder if none exists to begin with, otherwise the file upload fails with 404 (can't find the folder to upload to).
  • 46cd820 fix tests
  • 48ea390 add more tests for LocalFileSystemHandler
  • de32c97 Added the head method for files to check if a file exists without returning it as a body.

📊 Changes

17 files changed (+850 additions, -37 deletions)

View changed files

📝 Directory.Build.props (+1 -1)
📝 GitHubReleaseNotes.txt (+1 -1)
📝 examples/WireMock.Net.Client/Program.cs (+6 -0)
📝 examples/WireMock.Net.Console.Net452.Classic/CustomFileSystemFileHandler.cs (+34 -0)
📝 src/WireMock.Net/Client/IFluentMockServerAdmin.cs (+37 -0)
📝 src/WireMock.Net/Handlers/IFileSystemHandler.cs (+36 -8)
📝 src/WireMock.Net/Handlers/LocalFileSystemHandler.cs (+50 -8)
📝 src/WireMock.Net/ResponseMessageBuilder.cs (+8 -0)
📝 src/WireMock.Net/Serialization/MappingConverter.cs (+1 -1)
📝 src/WireMock.Net/Server/FluentMockServer.Admin.cs (+11 -3)
src/WireMock.Net/Server/FluentMockServer.AdminFiles.cs (+114 -0)
test/WireMock.Net.Tests/FLuentMockServerTests.AdminFiles.cs (+215 -0)
📝 test/WireMock.Net.Tests/FluentMockServerAdminRestClientTests.cs (+236 -2)
📝 test/WireMock.Net.Tests/FluentMockServerTests.Admin.cs (+4 -4)
📝 test/WireMock.Net.Tests/FluentMockServerTests.Settings.cs (+3 -3)
📝 test/WireMock.Net.Tests/Handlers/LocalFileSystemHandlerTests.cs (+43 -5)
📝 test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyTests.cs (+50 -1)

📄 Description

I've added endpoints for file upload/download/deletion (PUT/GET/DELETE) to allow for testing using files. The code is pretty basic but fulfills my requirements at the moment and has test coverage of happy paths.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/wiremock/WireMock.Net/pull/266 **Author:** [@JackCreativeCrew](https://github.com/JackCreativeCrew) **Created:** 4/8/2019 **Status:** ✅ Merged **Merged:** 4/11/2019 **Merged by:** [@StefH](https://github.com/StefH) **Base:** `master` ← **Head:** `265-file-upload` --- ### 📝 Commits (10+) - [`501b4f2`](https://github.com/wiremock/WireMock.Net/commit/501b4f239c09b197bc8dcac58a156ba61d1f0593) [265] Add file upload to allow mocking of file operations - [`df62498`](https://github.com/wiremock/WireMock.Net/commit/df6249874483672b5ced44b38b7cb6a85da3da61) [265] Fix failing test - [`dba0f7c`](https://github.com/wiremock/WireMock.Net/commit/dba0f7c789c4b27cbbb80e18ece9575b38e52b5a) Merge branch 'master' into 265-file-upload - [`c5ad05b`](https://github.com/wiremock/WireMock.Net/commit/c5ad05b9e04686eeb2981e28f02e692eda9635fe) Update code + add tests - [`be4aa88`](https://github.com/wiremock/WireMock.Net/commit/be4aa88d82cd9134b826c1eafeb58424054351d4) LocalFileSystemHandlerTests - [`f2cae2c`](https://github.com/wiremock/WireMock.Net/commit/f2cae2c45f540e3f49701d6405cbf9c49b753274) 1.0.13 - [`30ce475`](https://github.com/wiremock/WireMock.Net/commit/30ce475fe23c2714c1058c41597ac87e3d07d6a0) Fixed the file post to create the mapping folder if none exists to begin with, otherwise the file upload fails with 404 (can't find the folder to upload to). - [`46cd820`](https://github.com/wiremock/WireMock.Net/commit/46cd8205adf1bf3caf80b19875d9eaf1453aac3a) fix tests - [`48ea390`](https://github.com/wiremock/WireMock.Net/commit/48ea390046db9f6a7e3bbd85549b25f6df797d9d) add more tests for LocalFileSystemHandler - [`de32c97`](https://github.com/wiremock/WireMock.Net/commit/de32c97cd1463a9b383ff73f5a1a1ff9024e7c5b) Added the head method for files to check if a file exists without returning it as a body. ### 📊 Changes **17 files changed** (+850 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `Directory.Build.props` (+1 -1) 📝 `GitHubReleaseNotes.txt` (+1 -1) 📝 `examples/WireMock.Net.Client/Program.cs` (+6 -0) 📝 `examples/WireMock.Net.Console.Net452.Classic/CustomFileSystemFileHandler.cs` (+34 -0) 📝 `src/WireMock.Net/Client/IFluentMockServerAdmin.cs` (+37 -0) 📝 `src/WireMock.Net/Handlers/IFileSystemHandler.cs` (+36 -8) 📝 `src/WireMock.Net/Handlers/LocalFileSystemHandler.cs` (+50 -8) 📝 `src/WireMock.Net/ResponseMessageBuilder.cs` (+8 -0) 📝 `src/WireMock.Net/Serialization/MappingConverter.cs` (+1 -1) 📝 `src/WireMock.Net/Server/FluentMockServer.Admin.cs` (+11 -3) ➕ `src/WireMock.Net/Server/FluentMockServer.AdminFiles.cs` (+114 -0) ➕ `test/WireMock.Net.Tests/FLuentMockServerTests.AdminFiles.cs` (+215 -0) 📝 `test/WireMock.Net.Tests/FluentMockServerAdminRestClientTests.cs` (+236 -2) 📝 `test/WireMock.Net.Tests/FluentMockServerTests.Admin.cs` (+4 -4) 📝 `test/WireMock.Net.Tests/FluentMockServerTests.Settings.cs` (+3 -3) 📝 `test/WireMock.Net.Tests/Handlers/LocalFileSystemHandlerTests.cs` (+43 -5) 📝 `test/WireMock.Net.Tests/ResponseBuilders/ResponseWithBodyTests.cs` (+50 -1) </details> ### 📄 Description I've added endpoints for file upload/download/deletion (PUT/GET/DELETE) to allow for testing using files. The code is pretty basic but fulfills my requirements at the moment and has test coverage of happy paths. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 08:33:42 +01:00
adam closed this issue 2025-12-29 08:33:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#832