File tree Expand file tree Collapse file tree 11 files changed +40
-19
lines changed
AWS.Messaging.IntegrationTests
AWS.Messaging.Tests.Common Expand file tree Collapse file tree 11 files changed +40
-19
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "Projects" : [
3+ {
4+ "Name" : " AWS.Messaging" ,
5+ "Type" : " Minor" ,
6+ "ChangelogMessages" : [
7+ " Updated the .NET SDK dependencies to the latest version GA 4.0.0"
8+ ]
9+ }
10+ ]
11+ }
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ await Host.CreateDefaultBuilder(args)
4141 // builder.LoadConfigurationFromSettings(context.Configuration);
4242
4343 var mpfQueueUrl = context . Configuration [ "AWS:Resources:MPFQueueUrl" ] ;
44+ if ( string . IsNullOrEmpty ( mpfQueueUrl ) )
45+ throw new InvalidOperationException ( "Missing required configuration parameter 'AWS:Resources:MPFQueueUrl'." ) ;
4446
4547 builder . AddSQSPoller ( mpfQueueUrl ) ;
4648 builder . AddMessageHandler < ChatMessageHandler , ChatMessage > ( "chatMessage" ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ await Host.CreateDefaultBuilder(args)
3131 // builder.LoadConfigurationFromSettings(context.Configuration);
3232
3333 var mpfQueueUrl = context . Configuration [ "AWS:Resources:MPFQueueUrl" ] ;
34+ if ( string . IsNullOrEmpty ( mpfQueueUrl ) )
35+ throw new InvalidOperationException ( "Missing required configuration parameter 'AWS:Resources:MPFQueueUrl'." ) ;
3436
3537 builder . AddSQSPoller ( mpfQueueUrl ) ;
3638 builder . AddMessageHandler < ChatMessageHandler , ChatMessage > ( "chatMessage" ) ;
Original file line number Diff line number Diff line change 2727 </PropertyGroup >
2828
2929 <ItemGroup >
30- <PackageReference Include =" AWSSDK.EventBridge" Version =" 4.0.0-preview.11 " />
31- <PackageReference Include =" AWSSDK.Extensions.NETCore.Setup" Version =" 4.0.0-preview.11 " />
32- <PackageReference Include =" AWSSDK.SimpleNotificationService" Version =" 4.0.0-preview.11 " />
33- <PackageReference Include =" AWSSDK.SQS" Version =" 4.0.0-preview.11 " />
30+ <PackageReference Include =" AWSSDK.EventBridge" Version =" 4.0.0" />
31+ <PackageReference Include =" AWSSDK.Extensions.NETCore.Setup" Version =" 4.0.0" />
32+ <PackageReference Include =" AWSSDK.SimpleNotificationService" Version =" 4.0.0" />
33+ <PackageReference Include =" AWSSDK.SQS" Version =" 4.0.0" />
3434 <PackageReference Include =" Microsoft.Extensions.DependencyInjection" Version =" 8.0.*" />
3535 <PackageReference Include =" Microsoft.Extensions.Hosting.Abstractions" Version =" 8.0.*" />
3636 <PackageReference Include =" Microsoft.Extensions.Http" Version =" 8.0.*" />
Original file line number Diff line number Diff line change 99 </PropertyGroup >
1010
1111 <ItemGroup >
12- <PackageReference Include =" AWSSDK.CloudWatchLogs" Version =" 4.0.0-preview.11 " />
13- <PackageReference Include =" AWSSDK.IdentityManagement" Version =" 4.0.0-preview.11 " />
14- <PackageReference Include =" AWSSDK.Lambda" Version =" 4.0.0-preview.11 " />
15- <PackageReference Include =" AWSSDK.S3" Version =" 4.0.0-preview.11 " />
16- <PackageReference Include =" AWSSDK.SecurityToken" Version =" 4.0.0-preview.11 " />
12+ <PackageReference Include =" AWSSDK.CloudWatchLogs" Version =" 4.0.0" />
13+ <PackageReference Include =" AWSSDK.IdentityManagement" Version =" 4.0.0" />
14+ <PackageReference Include =" AWSSDK.Lambda" Version =" 4.0.0" />
15+ <PackageReference Include =" AWSSDK.S3" Version =" 4.0.0" />
16+ <PackageReference Include =" AWSSDK.SecurityToken" Version =" 4.0.0" />
1717 <PackageReference Include =" Microsoft.Extensions.DependencyInjection" Version =" 8.0.*" />
1818 <PackageReference Include =" Microsoft.Extensions.Logging.Abstractions" Version =" 8.0.*" />
1919 <PackageReference Include =" Microsoft.Extensions.Logging" Version =" 8.0.*" />
20- <PackageReference Include =" AWSSDK.Extensions.NETCore.Setup" Version =" 4.0.0-preview.11 " />
21- <PackageReference Include =" AWSSDK.SQS" Version =" 4.0.0-preview.11 " />
20+ <PackageReference Include =" AWSSDK.Extensions.NETCore.Setup" Version =" 4.0.0" />
21+ <PackageReference Include =" AWSSDK.SQS" Version =" 4.0.0" />
2222 <PackageReference Include =" xunit" Version =" 2.6.2" />
2323 <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.5.4" >
2424 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
Original file line number Diff line number Diff line change 99 </PropertyGroup >
1010
1111 <ItemGroup >
12- <PackageReference Include =" AWSSDK.CloudWatchLogs" Version =" 4.0.0-preview.11 " />
13- <PackageReference Include =" AWSSDK.IdentityManagement" Version =" 4.0.0-preview.11 " />
14- <PackageReference Include =" AWSSDK.Lambda" Version =" 4.0.0-preview.11 " />
15- <PackageReference Include =" AWSSDK.S3" Version =" 4.0.0-preview.11 " />
16- <PackageReference Include =" AWSSDK.SecurityToken" Version =" 4.0.0-preview.11 " />
17- <PackageReference Include =" AWSSDK.SQS" Version =" 4.0.0-preview.11 " />
12+ <PackageReference Include =" AWSSDK.CloudWatchLogs" Version =" 4.0.0" />
13+ <PackageReference Include =" AWSSDK.IdentityManagement" Version =" 4.0.0" />
14+ <PackageReference Include =" AWSSDK.Lambda" Version =" 4.0.0" />
15+ <PackageReference Include =" AWSSDK.S3" Version =" 4.0.0" />
16+ <PackageReference Include =" AWSSDK.SecurityToken" Version =" 4.0.0" />
17+ <PackageReference Include =" AWSSDK.SQS" Version =" 4.0.0" />
1818 <PackageReference Include =" Microsoft.Extensions.DependencyInjection" Version =" 8.0.*" />
1919 <PackageReference Include =" Microsoft.Extensions.Logging.Abstractions" Version =" 8.0.*" />
2020 <PackageReference Include =" Microsoft.Extensions.Logging" Version =" 8.0.*" />
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public InMemoryLogger(LoggerExternalScopeProvider scopeProvider)
3333
3434 public IEnumerable < LogItem > Logs => concurrentLogs . ToList ( ) ;
3535
36- public IDisposable BeginScope < TState > ( TState state ) => _scopeProvider . Push ( state ) ;
36+ public IDisposable BeginScope < TState > ( TState state ) where TState : notnull => _scopeProvider . Push ( state ) ;
3737
3838 public bool IsEnabled ( LogLevel logLevel ) => logLevel != LogLevel . None ;
3939
@@ -52,4 +52,4 @@ public static ILoggingBuilder AddInMemoryLogger(this ILoggingBuilder builder)
5252 return builder . AddProvider ( new InMemoryLoggerProvider ( logger ) ) ;
5353 }
5454 }
55- }
55+ }
Original file line number Diff line number Diff line change @@ -426,9 +426,11 @@ public async Task ProcessMessageGroupAsync_WhenMessageFails_RemovesSkippedMessag
426426 // Access _inFlightMessageMetadata through reflection
427427 var inFlightMessageMetadataField = typeof ( DefaultMessageManager )
428428 . GetField ( "_inFlightMessageMetadata" , System . Reflection . BindingFlags . NonPublic | System . Reflection . BindingFlags . Instance ) ;
429+ Assert . NotNull ( inFlightMessageMetadataField ) ;
429430 var inFlightMessageMetadata = inFlightMessageMetadataField . GetValue ( manager ) as ConcurrentDictionary < MessageEnvelope , InFlightMetadata > ;
430431
431432 // Assert
433+ Assert . NotNull ( inFlightMessageMetadata ) ;
432434 Assert . False ( inFlightMessageMetadata . ContainsKey ( message2 ) ,
433435 "Skipped message should not remain in _inFlightMessageMetadata after group failure" ) ;
434436
Original file line number Diff line number Diff line change @@ -733,6 +733,7 @@ public async Task ConvertToEnvelope_NullSubscriberMapping_ThrowsException()
733733 // Verify the inner exception type and message
734734 Assert . IsType < InvalidDataException > ( exception . InnerException ) ;
735735 var innerException = exception . InnerException as InvalidDataException ;
736+ Assert . NotNull ( innerException ) ;
736737 Assert . Contains ( "'unknownMessageType' is not a valid subscriber mapping." , innerException . Message ) ;
737738 Assert . Contains ( "Available mappings:" , innerException . Message ) ;
738739 Assert . Contains ( "addressInfo" , innerException . Message ) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ public void CreateSQSMetadata_WithBasicMessage_ReturnsCorrectMetadata()
3232 // Assert
3333 Assert . Equal ( "test-message-id" , metadata . MessageID ) ;
3434 Assert . Equal ( "test-receipt-handle" , metadata . ReceiptHandle ) ;
35+ Assert . NotNull ( metadata . MessageAttributes ) ;
3536 Assert . Single ( metadata . MessageAttributes ) ;
3637 Assert . Equal ( "TestValue" , metadata . MessageAttributes [ "TestAttribute" ] . StringValue ) ;
3738 }
@@ -140,6 +141,7 @@ public void CreateEventBridgeMetadata_WithValidJson_ReturnsCorrectMetadata()
140141 Assert . Equal ( "123456789012" , metadata . AWSAccount ) ;
141142 Assert . Equal ( DateTimeOffset . Parse ( "2024-03-15T10:00:00Z" ) , metadata . Time ) ;
142143 Assert . Equal ( "us-east-1" , metadata . AWSRegion ) ;
144+ Assert . NotNull ( metadata . Resources ) ;
143145 Assert . Equal ( 2 , metadata . Resources . Count ) ;
144146 Assert . Contains ( "resource1" , metadata . Resources ) ;
145147 Assert . Contains ( "resource2" , metadata . Resources ) ;
You can’t perform that action at this time.
0 commit comments