refactor: address code review findings across all projects
Apply comprehensive fixes from code reviews including: - Extract shared utilities (SqlFormatHelper, CellValueConverter, DbDestinationBase) - Add interface abstractions (IAuthenticationService, IDatabaseMigrator, IMisQueryBuilder) - Implement SecureStore for encrypted secrets storage - Fix error handling with proper HTTP status codes and logging - Optimize double enumeration in DevEtlRegistry - Add DataSync.Dev README for developer onboarding - Extract filter panel base classes to reduce duplication - Update code review docs to mark all issues as fixed
This commit is contained in:
@@ -14,6 +14,11 @@ using Microsoft.Extensions.Logging;
|
||||
using NSubstitute;
|
||||
using Shouldly;
|
||||
|
||||
// Alias to avoid conflict with JdeScoping.Core.Interfaces.IAuthenticationService
|
||||
using IAspNetAuthService = Microsoft.AspNetCore.Authentication.IAuthenticationService;
|
||||
// Alias to match AuthController naming convention
|
||||
using IAuthService = JdeScoping.Core.Interfaces.IAuthenticationService;
|
||||
|
||||
namespace JdeScoping.Api.Tests.Controllers;
|
||||
|
||||
public class AuthControllerTests
|
||||
@@ -186,14 +191,14 @@ public class AuthControllerTests
|
||||
|
||||
private static HttpContext CreateMockHttpContext()
|
||||
{
|
||||
var authServiceMock = Substitute.For<IAuthenticationService>();
|
||||
var authServiceMock = Substitute.For<IAspNetAuthService>();
|
||||
authServiceMock.SignOutAsync(Arg.Any<HttpContext>(), Arg.Any<string>(), Arg.Any<AuthenticationProperties>())
|
||||
.Returns(Task.CompletedTask);
|
||||
authServiceMock.SignInAsync(Arg.Any<HttpContext>(), Arg.Any<string>(), Arg.Any<ClaimsPrincipal>(), Arg.Any<AuthenticationProperties>())
|
||||
.Returns(Task.CompletedTask);
|
||||
|
||||
var serviceProvider = Substitute.For<IServiceProvider>();
|
||||
serviceProvider.GetService(typeof(IAuthenticationService)).Returns(authServiceMock);
|
||||
serviceProvider.GetService(typeof(IAspNetAuthService)).Returns(authServiceMock);
|
||||
|
||||
var httpContext = new DefaultHttpContext
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user