Skip to content

Commit

Permalink
refactor(repeater): refrain from supporting websockets
Browse files Browse the repository at this point in the history
  • Loading branch information
derevnjuk committed Oct 2, 2023
1 parent bc4303c commit 8573f3a
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 678 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public static IServiceCollection AddSecTesterRepeater(this IServiceCollection co
.AddScoped<IRepeaterFactory, DefaultRepeaterFactory>()
.AddScoped<IRepeaters, DefaultRepeaters>()
.AddScoped<ITimerProvider, SystemTimerProvider>()
.AddScoped<IWebSocketFactory, DefaultWebSocketFactory>()
.AddScoped<IRequestRunner, HttpRequestRunner>()
.AddScoped<IRequestRunner, WsRequestRunner>()
.AddScoped<RequestRunnerResolver>(sp =>
protocol => sp.GetServices<IRequestRunner>().FirstOrDefault(x => x.Protocol == protocol)
)
Expand Down
3 changes: 1 addition & 2 deletions src/SecTester.Repeater/Protocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ namespace SecTester.Repeater;

public enum Protocol
{
Http,
Ws
Http
}
35 changes: 0 additions & 35 deletions src/SecTester.Repeater/Runners/DefaultWebSocketFactory.cs

This file was deleted.

2 changes: 0 additions & 2 deletions src/SecTester.Repeater/Runners/IRequest.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text.RegularExpressions;

namespace SecTester.Repeater.Runners;

public interface IRequest
{
string? Body { get; init; }
Regex? CorrelationIdRegex { get; init; }
HttpMethod Method { get; init; }
Protocol Protocol { get; init; }
Uri Url { get; init; }
Expand Down
12 changes: 0 additions & 12 deletions src/SecTester.Repeater/Runners/IWebSocketFactory.cs

This file was deleted.

17 changes: 0 additions & 17 deletions src/SecTester.Repeater/Runners/WebSocketResponseBody.cs

This file was deleted.

164 changes: 0 additions & 164 deletions src/SecTester.Repeater/Runners/WsRequestRunner.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public void AddSecTesterRepeater_RegistersRequestRunnerRegistry()
var result = provider.GetRequiredService<RequestRunnerResolver>();

result(Protocol.Http).Should().BeOfType(typeof(HttpRequestRunner));
result(Protocol.Ws).Should().BeOfType(typeof(WsRequestRunner));
}

[Fact]
Expand Down
Loading

0 comments on commit 8573f3a

Please sign in to comment.