Skip to content

Commit 5cc31c0

Browse files
committed
Update Postman collection and refactor command handlers
- Modified tests in `Genocs Library.postman_collection.json` to check for "Identities Service" and updated URL parameters to use generic placeholders. - Changed POST request body to reflect an empty "Products" array. - Refactored several command handler classes from `internal` to `public`, enhancing accessibility and updated constructors to include `IMessageBroker` and `ILogger` for improved dependency injection.
1 parent 3fe8ead commit 5cc31c0

File tree

9 files changed

+37
-24
lines changed

9 files changed

+37
-24
lines changed

postman/Genocs Library.postman_collection.json

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,9 +1064,9 @@
10641064
"});\r",
10651065
"\r",
10661066
"pm.test(\"Body is correct\", function () {\r",
1067-
" // This test check the Identity Service response on the home\r",
1068-
" // The response must contains a string \"Identity Service\" \r",
1069-
" pm.response.to.have.body(\"Identity Service\");\r",
1067+
" // This test check the Identities Service response on the home\r",
1068+
" // The response must contains a string \"Identities Service\" \r",
1069+
" pm.response.to.have.body(\"Identities Service\");\r",
10701070
"});"
10711071
],
10721072
"type": "text/javascript",
@@ -1571,9 +1571,9 @@
15711571
"method": "GET",
15721572
"header": [],
15731573
"url": {
1574-
"raw": "{{gnx-lib-url-products}}",
1574+
"raw": "{{products}}",
15751575
"host": [
1576-
"{{gnx-lib-url-products}}"
1576+
"{{products}}"
15771577
]
15781578
}
15791579
},
@@ -1636,13 +1636,12 @@
16361636
"method": "GET",
16371637
"header": [],
16381638
"url": {
1639-
"raw": "{{products}}/products/6bdbca11-54a2-469c-b212-0a4f315ae306",
1639+
"raw": "{{products}}/{{product_location}}",
16401640
"host": [
16411641
"{{products}}"
16421642
],
16431643
"path": [
1644-
"products",
1645-
"6bdbca11-54a2-469c-b212-0a4f315ae306"
1644+
"{{product_location}}"
16461645
]
16471646
}
16481647
},
@@ -1658,11 +1657,25 @@
16581657
"pm.test(\"Status code is 201 - Created\", function () {\r",
16591658
" pm.response.to.have.status(201);\r",
16601659
"});\r",
1661-
""
1660+
"\r",
1661+
"pm.test(\"Response time is less than 400ms\", function () {\r",
1662+
" pm.expect(pm.response.responseTime).to.be.below(400);\r",
1663+
"});\r",
1664+
"\r",
1665+
"pm.test(\"Get Product Location\", function () {\r",
1666+
" pm.environment.set(\"product_location\", pm.response.headers.get(\"Location\"));\r",
1667+
"});"
16621668
],
16631669
"type": "text/javascript",
16641670
"packages": {}
16651671
}
1672+
},
1673+
{
1674+
"listen": "prerequest",
1675+
"script": {
1676+
"packages": {},
1677+
"type": "text/javascript"
1678+
}
16661679
}
16671680
],
16681681
"request": {
@@ -1717,9 +1730,9 @@
17171730
"method": "GET",
17181731
"header": [],
17191732
"url": {
1720-
"raw": "{{gnx-lib-url-orders}}",
1733+
"raw": "{{orders}}",
17211734
"host": [
1722-
"{{gnx-lib-url-orders}}"
1735+
"{{orders}}"
17231736
]
17241737
}
17251738
},
@@ -1746,17 +1759,17 @@
17461759
"header": [],
17471760
"body": {
17481761
"mode": "raw",
1749-
"raw": "{\r\n \"CustomerId\": \"98ec44ff-d6ce-40cf-9ab0-83f3db3009d0\",\r\n \"ProductId\": \"9759c776-809f-4538-a382-bc1a51a404ab\"\r\n}",
1762+
"raw": "{\r\n \"CustomerId\": \"98ec44ff-d6ce-40cf-9ab0-83f3db3009d0\",\r\n \"Products\": []\r\n}",
17501763
"options": {
17511764
"raw": {
17521765
"language": "json"
17531766
}
17541767
}
17551768
},
17561769
"url": {
1757-
"raw": "{{gnx-lib-url-orders}}/orders",
1770+
"raw": "{{orders}}/orders",
17581771
"host": [
1759-
"{{gnx-lib-url-orders}}"
1772+
"{{orders}}"
17601773
],
17611774
"path": [
17621775
"orders"
@@ -1793,9 +1806,9 @@
17931806
"method": "GET",
17941807
"header": [],
17951808
"url": {
1796-
"raw": "{{gnx-lib-url-signalr}}",
1809+
"raw": "{{signalr}}",
17971810
"host": [
1798-
"{{gnx-lib-url-signalr}}"
1811+
"{{signalr}}"
17991812
]
18001813
}
18011814
},

src/apps/identity/Identities.Application/Commands/Handlers/CreateAdminHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Genocs.Identities.Application.Commands.Handlers;
1212

13-
internal sealed class CreateAdminHandler(IUserRepository userRepository, IPasswordService passwordService,
13+
public sealed class CreateAdminHandler(IUserRepository userRepository, IPasswordService passwordService,
1414
IMessageBroker messageBroker, ILogger<CreateAdminHandler> logger) : ICommandHandler<CreateAdmin>
1515
{
1616
private readonly IUserRepository _userRepository = userRepository;

src/apps/identity/Identities.Application/Commands/Handlers/CreateUserHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Genocs.Identities.Application.Commands.Handlers;
1212

13-
internal sealed class CreateUserHandler(IUserRepository userRepository, IPasswordService passwordService,
13+
public sealed class CreateUserHandler(IUserRepository userRepository, IPasswordService passwordService,
1414
IMessageBroker messageBroker, ILogger<CreateUserHandler> logger) : ICommandHandler<CreateUser>
1515
{
1616
private readonly IUserRepository _userRepository = userRepository;

src/apps/identity/Identities.Application/Commands/Handlers/LockUserHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Genocs.Identities.Application.Commands.Handlers;
88

9-
internal sealed class LockUserHandler(IUserRepository userRepository, IMessageBroker messageBroker) : ICommandHandler<LockUser>
9+
public sealed class LockUserHandler(IUserRepository userRepository, IMessageBroker messageBroker) : ICommandHandler<LockUser>
1010
{
1111
private readonly IUserRepository _userRepository = userRepository;
1212
private readonly IMessageBroker _messageBroker = messageBroker;

src/apps/identity/Identities.Application/Commands/Handlers/RevokeAccessTokenHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Genocs.Identities.Application.Commands.Handlers;
55

6-
internal sealed class RevokeAccessTokenHandler(IAccessTokenService accessTokenService)
6+
public sealed class RevokeAccessTokenHandler(IAccessTokenService accessTokenService)
77
: ICommandHandler<RevokeAccessToken>
88
{
99
private readonly IAccessTokenService _accessTokenService = accessTokenService

src/apps/identity/Identities.Application/Commands/Handlers/RevokeRefreshTokenHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Genocs.Identities.Application.Commands.Handlers;
66

7-
internal sealed class RevokeRefreshTokenHandler : ICommandHandler<RevokeRefreshToken>
7+
public sealed class RevokeRefreshTokenHandler : ICommandHandler<RevokeRefreshToken>
88
{
99
private readonly IRefreshTokenRepository _refreshTokenRepository;
1010

src/apps/identity/Identities.Application/Commands/Handlers/SignInHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Genocs.Identities.Application.Commands.Handlers;
1010

11-
internal sealed class SignInHandler : ICommandHandler<SignIn>
11+
public sealed class SignInHandler : ICommandHandler<SignIn>
1212
{
1313
private readonly IUserRepository _userRepository;
1414
private readonly IRefreshTokenRepository _refreshTokenRepository;

src/apps/identity/Identities.Application/Commands/Handlers/UnlockUserHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Genocs.Identities.Application.Commands.Handlers;
88

9-
internal sealed class UnlockUserHandler(IUserRepository userRepository, IMessageBroker messageBroker)
9+
public sealed class UnlockUserHandler(IUserRepository userRepository, IMessageBroker messageBroker)
1010
: ICommandHandler<UnlockUser>
1111
{
1212
private readonly IUserRepository _userRepository = userRepository;

src/apps/identity/Identities.Application/Commands/Handlers/UseRefreshTokenHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Genocs.Identities.Application.Commands.Handlers;
88

9-
internal sealed class UseRefreshTokenHandler : ICommandHandler<UseRefreshToken>
9+
public sealed class UseRefreshTokenHandler : ICommandHandler<UseRefreshToken>
1010
{
1111
private readonly IRefreshTokenRepository _refreshTokenRepository;
1212
private readonly IUserRepository _userRepository;

0 commit comments

Comments
 (0)