@@ -1619,6 +1619,68 @@ describe('SyncConfig', () => {
1619
1619
expect ( result ) . toMatchSnapshot ( ) ;
1620
1620
} ) ;
1621
1621
1622
+ test ( 'Pipeline Resolver Function uses default' , ( ) => {
1623
+ const apiConfig = {
1624
+ ...config ,
1625
+ functionConfigurationsLocation : 'mapping-templates' ,
1626
+ functionConfigurations : [
1627
+ {
1628
+ dataSource : 'ds' ,
1629
+ name : 'pipeline' ,
1630
+ request : 'request.vtl' ,
1631
+ response : 'response.vtl' ,
1632
+ sync : true ,
1633
+ } ,
1634
+ ] ,
1635
+ } ;
1636
+
1637
+ const apiResources = plugin . getFunctionConfigurationResources ( apiConfig ) ;
1638
+ expect (
1639
+ apiResources . GraphQlFunctionConfigurationpipeline . Properties ,
1640
+ ) . toHaveProperty ( 'SyncConfig' ) ;
1641
+ expect (
1642
+ apiResources . GraphQlFunctionConfigurationpipeline . Properties . SyncConfig ,
1643
+ ) . toEqual ( {
1644
+ ConflictDetection : 'VERSION' ,
1645
+ } ) ;
1646
+ } ) ;
1647
+
1648
+ test ( 'Pipeline Resolver Function uses advanced config' , ( ) => {
1649
+ const apiConfig = {
1650
+ ...config ,
1651
+ functionConfigurationsLocation : 'mapping-templates' ,
1652
+ functionConfigurations : [
1653
+ {
1654
+ dataSource : 'ds' ,
1655
+ name : 'pipeline' ,
1656
+ request : 'request.vtl' ,
1657
+ response : 'response.vtl' ,
1658
+ sync : {
1659
+ conflictDetection : 'VERSION' ,
1660
+ conflictHandler : 'LAMBDA' ,
1661
+ functionName : 'syncLambda' ,
1662
+ } ,
1663
+ } ,
1664
+ ] ,
1665
+ } ;
1666
+
1667
+ const apiResources = plugin . getFunctionConfigurationResources ( apiConfig ) ;
1668
+ expect (
1669
+ apiResources . GraphQlFunctionConfigurationpipeline . Properties ,
1670
+ ) . toHaveProperty ( 'SyncConfig' ) ;
1671
+ expect (
1672
+ apiResources . GraphQlFunctionConfigurationpipeline . Properties . SyncConfig ,
1673
+ ) . toEqual ( {
1674
+ ConflictDetection : 'VERSION' ,
1675
+ ConflictHandler : 'LAMBDA' ,
1676
+ LambdaConflictHandlerConfig : {
1677
+ LambdaConflictHandlerArn : {
1678
+ 'Fn::GetAtt' : [ 'SyncLambdaLambdaFunction' , 'Arn' ] ,
1679
+ } ,
1680
+ } ,
1681
+ } ) ;
1682
+ } ) ;
1683
+
1622
1684
test ( 'Uses lambda config' , ( ) => {
1623
1685
Object . assign ( config , {
1624
1686
mappingTemplates : [
0 commit comments