1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-04 20:50:21 -05:00

Updated with changes from PR comments

This commit is contained in:
Brant DeBow 2025-04-02 09:31:35 -04:00
parent de7c2f7063
commit 3957f81d6b
No known key found for this signature in database
GPG Key ID: 94411BB25947C72B
5 changed files with 10 additions and 10 deletions

View File

@ -36,7 +36,7 @@ public class OrganizationIntegrationConfigurationDetails
{
try
{
var configuration = Configuration ?? "{}";
var configuration = Configuration ?? string.Empty;
return JsonNode.Parse(configuration) as JsonObject ?? new JsonObject();
}
catch
@ -52,7 +52,7 @@ public class OrganizationIntegrationConfigurationDetails
{
try
{
var integration = IntegrationConfiguration ?? "{}";
var integration = IntegrationConfiguration ?? string.Empty;
return JsonNode.Parse(integration) as JsonObject ?? new JsonObject();
}
catch

View File

@ -6,7 +6,7 @@ namespace Bit.Core.Repositories;
public interface IOrganizationIntegrationConfigurationRepository : IRepository<OrganizationIntegrationConfiguration, Guid>
{
Task<List<OrganizationIntegrationConfigurationDetails>> GetConfigurationsAsync(
Task<List<OrganizationIntegrationConfigurationDetails>> GetConfigurationDetailsAsync(
Guid organizationId,
IntegrationType integrationType,
EventType eventType);

View File

@ -20,7 +20,7 @@ public class OrganizationIntegrationConfigurationRepository : Repository<Organiz
: base(connectionString, readOnlyConnectionString)
{ }
public async Task<List<OrganizationIntegrationConfigurationDetails>> GetConfigurationsAsync(
public async Task<List<OrganizationIntegrationConfigurationDetails>> GetConfigurationDetailsAsync(
Guid organizationId,
IntegrationType integrationType,
EventType eventType)

View File

@ -16,7 +16,7 @@ public class OrganizationIntegrationConfigurationRepository : Repository<Core.Ad
: base(serviceScopeFactory, mapper, context => context.OrganizationIntegrationConfigurations)
{ }
public async Task<List<OrganizationIntegrationConfigurationDetails>> GetConfigurationsAsync(
public async Task<List<OrganizationIntegrationConfigurationDetails>> GetConfigurationDetailsAsync(
Guid organizationId,
IntegrationType integrationType,
EventType eventType)

View File

@ -7,7 +7,7 @@ namespace Bit.Core.Test.Models.Data.Organizations;
public class OrganizationIntegrationConfigurationDetailsTests
{
[Fact]
public void MergedConfiguration_BothHaveValues()
public void MergedConfiguration_WithValidConfigAndIntegration_ReturnsMergedJson()
{
var config = new { config = "A new config value" };
var integration = new { integration = "An integration value" };
@ -23,7 +23,7 @@ public class OrganizationIntegrationConfigurationDetailsTests
}
[Fact]
public void MergedConfiguration_BothNotJson()
public void MergedConfiguration_WithInvalidJsonConfigAndIntegration_ReturnsEmptyJson()
{
var expectedObj = new { };
var expected = JsonSerializer.Serialize(expectedObj);
@ -37,7 +37,7 @@ public class OrganizationIntegrationConfigurationDetailsTests
}
[Fact]
public void MergedConfiguration_BothNull()
public void MergedConfiguration_WithNullConfigAndIntegration_ReturnsEmptyJson()
{
var expectedObj = new { };
var expected = JsonSerializer.Serialize(expectedObj);
@ -51,7 +51,7 @@ public class OrganizationIntegrationConfigurationDetailsTests
}
[Fact]
public void MergedConfiguration_ConfigNull()
public void MergedConfiguration_WithValidIntegrationAndNullConfig_ReturnsIntegrationJson()
{
var integration = new { integration = "An integration value" };
var expectedObj = new { integration = "An integration value" };
@ -66,7 +66,7 @@ public class OrganizationIntegrationConfigurationDetailsTests
}
[Fact]
public void MergedConfiguration_IntegrationNull()
public void MergedConfiguration_WithValidConfigAndNullIntegration_ReturnsConfigJson()
{
var config = new { config = "A new config value" };
var expectedObj = new { config = "A new config value" };