public void testFindInputsWithTestDefaultValues()

in javatests/com/google/cloud/deploymentmanager/autogen/SoyFunctionsTest.java [149:192]


  public void testFindInputsWithTestDefaultValues() {
    DeployInputField nonRequired = DeployInputField.newBuilder()
        .setRequired(false)
        .build();

    IntegerBox intBoxWithDefaultValue = IntegerBox.newBuilder()
        .setDefaultValue(OptionalInt32.newBuilder().setValue(10).build())
        .build();
    DeployInputField requiredIntWithDefaultValue = DeployInputField.newBuilder()
        .setRequired(true)
        .setIntegerBox(intBoxWithDefaultValue)
        .build();

    IntegerBox boxWithoutDefaultValue = IntegerBox.newBuilder()
        .setTestDefaultValue(OptionalInt32.newBuilder().setValue(10).build())
        .build();
    DeployInputField requiredWithoutDefaultValue = DeployInputField.newBuilder()
        .setRequired(true)
        .setName("TruePositive")
        .setIntegerBox(boxWithoutDefaultValue)
        .build();

    StringBox boxWithDefaultValue = StringBox.newBuilder()
        .setDefaultValue("some default")
        .build();
    DeployInputField requiredStringWithDefaultValue = DeployInputField.newBuilder()
        .setRequired(true)
        .setStringBox(boxWithDefaultValue)
        .build();

    DeployInputSection section = DeployInputSection.newBuilder()
        .addFields(nonRequired)
        .addFields(requiredIntWithDefaultValue)
        .addFields(requiredStringWithDefaultValue)
        .addFields(requiredWithoutDefaultValue)
        .build();

    DeployInputSpec spec = DeployInputSpec.newBuilder()
        .addSections(section)
        .build();

    assertFunctionCall(findInputsWithTestDefaultValues, spec)
        .hasIterableResultThat().containsExactly(toSoyValue(requiredWithoutDefaultValue));
  }