fun canUpdateAScalarValue()

in jetbrains-core/tst/software/aws/toolkits/jetbrains/services/cloudformation/yaml/YamlCloudFormationTemplateTest.kt [145:188]


    fun canUpdateAScalarValue() {
        val updatedTemplate = runInEdtAndGet {
            val template = yamlTemplate()
            val resource = template.getResourceByName("MyFunction")
            resource!!.setScalarProperty("CodeUri", "new/uri.jar")
            template.text()
        }

        assertThat(updatedTemplate).isEqualTo(
            """
Description: "Some description"
Parameters:
    TableName:
        Default: someTable
        Description: Storage for your data
        ConstraintDescription: No emojis
    TableTag:
        Description: Tag to add to the DynamoDb table
Resources:
    MyFunction:
        Type: AWS::Serverless::Function
        Properties:
            Handler: helloworld.App::handleRequest
            Runtime: java8
            CodeUri: new/uri.jar
    MyDynamoTable:
        Type: AWS::DynamoDB::Table
        Properties:
            AttributeDefinitions:
                - AttributeName: "ArtistId"
                  AttributeType: "S"
                - AttributeName: "Concert"
                  AttributeType: "S"
            KeySchema:
                - AttributeName: "ArtistId"
                  KeyType: "HASH"
                - AttributeName: "Concert"
                  KeyType: "RANGE"
            ProvisionedThroughput:
                ReadCapacityUnits: 1
                WriteCapacityUnits: 1
            """.trimIndent()
        )
    }