Skip to content

Commit

Permalink
removed reply_urls validation (#89)
Browse files Browse the repository at this point in the history
fixes #88
  • Loading branch information
Steve Hawkins authored and katbyte committed May 31, 2019
1 parent 9712651 commit b39d6fa
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion azuread/resource_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func resourceApplication() *schema.Resource {
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: validate.URLIsHTTPOrHTTPS,
ValidateFunc: validate.NoEmptyStrings,
},
},

Expand Down
42 changes: 40 additions & 2 deletions azuread/resource_application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
"regexp"
"testing"

"github.com/terraform-providers/terraform-provider-azuread/azuread/helpers/ar"

"github.com/google/uuid"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"github.com/terraform-providers/terraform-provider-azuread/azuread/helpers/ar"
)

func TestAccAzureADApplication_basic(t *testing.T) {
Expand Down Expand Up @@ -203,6 +202,35 @@ func TestAccAzureADApplication_native(t *testing.T) {
})
}

func TestAccAzureADApplication_nativeReplyUrls(t *testing.T) {
resourceName := "azuread_application.test"
id := uuid.New().String()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckADApplicationDestroy,
Steps: []resource.TestStep{
{
Config: testAccADApplication_nativeReplyUrls(id),
Check: resource.ComposeTestCheckFunc(
testCheckADApplicationExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "name", fmt.Sprintf("acctest%s", id)),
resource.TestCheckResourceAttr(resourceName, "type", "native"),
resource.TestCheckResourceAttr(resourceName, "reply_urls.#", "1"),
resource.TestCheckResourceAttr(resourceName, "reply_urls.3637476042", "urn:ietf:wg:oauth:2.0:oob"),
resource.TestCheckResourceAttrSet(resourceName, "application_id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureADApplication_nativeUpdate(t *testing.T) {
resourceName := "azuread_application.test"
id := uuid.New().String()
Expand Down Expand Up @@ -414,6 +442,16 @@ resource "azuread_application" "test" {
`, id)
}

func testAccADApplication_nativeReplyUrls(id string) string {
return fmt.Sprintf(`
resource "azuread_application" "test" {
name = "acctest%s"
type = "native"
reply_urls = ["urn:ietf:wg:oauth:2.0:oob"]
}
`, id)
}

func testAccADApplication_native_app_does_not_allow_identifier_uris(id string) string {
return fmt.Sprintf(`
resource "azuread_application" "test" {
Expand Down

0 comments on commit b39d6fa

Please sign in to comment.