File tree 1 file changed +9
-10
lines changed
Tests/AWSLambdaRuntimeCoreTests
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 12
12
//
13
13
//===----------------------------------------------------------------------===//
14
14
15
+ import Foundation
15
16
import NIOHTTP1
16
- import XCTest
17
+ import Testing
17
18
18
19
@testable import AWSLambdaRuntimeCore
19
20
20
- class InvocationTest : XCTestCase {
21
+ @Suite
22
+ struct InvocationTest {
23
+ @Test
21
24
func testInvocationTraceID( ) throws {
22
25
let headers = HTTPHeaders ( [
23
26
( AmazonHeaders . requestID, " test " ) ,
24
27
( AmazonHeaders . deadline, String ( Date ( timeIntervalSinceNow: 60 ) . millisSinceEpoch) ) ,
25
28
( AmazonHeaders . invokedFunctionARN, " arn:aws:lambda:us-east-1:123456789012:function:custom-runtime " ) ,
26
29
] )
27
30
28
- var invocation : InvocationMetadata ?
31
+ var maybeInvocation : InvocationMetadata ?
29
32
30
- XCTAssertNoThrow ( invocation = try InvocationMetadata ( headers: headers) )
31
- XCTAssertNotNil ( invocation)
32
-
33
- guard !invocation!. traceID. isEmpty else {
34
- XCTFail ( " Invocation traceID is empty " )
35
- return
36
- }
33
+ #expect( throws: Never . self) { maybeInvocation = try InvocationMetadata ( headers: headers) }
34
+ let invocation = try #require( maybeInvocation)
35
+ #expect( !invocation. traceID. isEmpty)
37
36
}
38
37
}
You can’t perform that action at this time.
0 commit comments