Skip to content

Commit 14db51b

Browse files
authored
fix: predictions plugin public init (#3011)
1 parent a77cb94 commit 14db51b

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

AmplifyPlugins/Predictions/AWSPredictionsPlugin/AWSPredictionsPlugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final public class AWSPredictionsPlugin: PredictionsCategoryPlugin {
3030
predictionsService.getEscapeHatch(client: key)
3131
}
3232

33-
init() {}
33+
public init() {}
3434
}
3535

3636
extension AWSPredictionsPlugin: AmplifyVersionable { }
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// Copyright Amazon.com Inc. or its affiliates.
3+
// All Rights Reserved.
4+
//
5+
// SPDX-License-Identifier: Apache-2.0
6+
//
7+
8+
import XCTest
9+
// This import statement needs to stay as it is.
10+
// Do not add @testable
11+
import AWSPredictionsPlugin
12+
13+
class PredictionsPluginInitTestCase: XCTest {
14+
/// Given: A non @testable import of the `AWSPredictionsPlugin` module
15+
/// When: Initializing the `AWSPredictionsPlugin` class
16+
/// Then: The init should not result in a compiler error
17+
///
18+
/// - Note: The assertion here is that the plugin's init remains
19+
/// public. In the case of a regression (i.e. making the init private / internal),
20+
/// the test target will fail to build.
21+
func testPublicInitializer() {
22+
_ = AWSPredictionsPlugin()
23+
}
24+
}

0 commit comments

Comments
 (0)