Skip to content

Commit c7e126b

Browse files
committed
fix: fix issue with sample requests not applying
1 parent 6b08eee commit c7e126b

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Projects": [
3+
{
4+
"Name": "Amazon.Lambda.TestTool",
5+
"Type": "Patch",
6+
"ChangelogMessages": [
7+
"Fix issue causing sample requests to not be applied if a config path is not supplied"
8+
]
9+
}
10+
]
11+
}

Tools/LambdaTestTool-v2/src/Amazon.Lambda.TestTool/Services/LambdaRequestManager.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33

44
using System.Xml.Linq;
55
using Amazon.Lambda.TestTool.Models;
6+
using Amazon.Lambda.TestTool.Services.IO;
67
using Microsoft.Extensions.Options;
78

89
namespace Amazon.Lambda.TestTool.Services;
910

1011
/// <summary>
1112
/// This class manages the sample Lambda input requests. This includes the pre-canned requests and saved requests.
1213
/// </summary>
13-
public class LambdaRequestManager(IOptions<LambdaOptions> lambdaOptions) : ILambdaRequestManager
14+
public class LambdaRequestManager(IOptions<LambdaOptions> lambdaOptions, IDirectoryManager directoryManager) : ILambdaRequestManager
1415
{
15-
private string? GetRequestDirectory(string functionName) => !string.IsNullOrEmpty(lambdaOptions.Value.ConfigStoragePath) ? Path.Combine(lambdaOptions.Value.ConfigStoragePath, Constants.SavedRequestDirectory, functionName) : null;
16+
private string? GetRequestDirectory(string functionName) => !string.IsNullOrEmpty(lambdaOptions.Value.ConfigStoragePath) ? Path.Combine(lambdaOptions.Value.ConfigStoragePath, Constants.SavedRequestDirectory, functionName) : Path.Combine(directoryManager.GetCurrentDirectory(), Constants.SavedRequestDirectory);
1617

1718
/// <inheritdoc />
1819
public IDictionary<string, IList<LambdaRequest>> GetLambdaRequests(string functionName, bool includeSampleRequests = true, bool includeSavedRequests = true)

0 commit comments

Comments
 (0)