Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore order for reply_urls #61

Merged
merged 2 commits into from
Apr 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions azuread/resource_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func resourceApplication() *schema.Resource {
},

"reply_urls": {
Type: schema.TypeList,
Type: schema.TypeSet,
Optional: true,
Computed: true,
Elem: &schema.Schema{
Expand Down Expand Up @@ -124,7 +124,7 @@ func resourceApplicationCreate(d *schema.ResourceData, meta interface{}) error {
DisplayName: &name,
Homepage: expandADApplicationHomepage(d, name),
IdentifierUris: tf.ExpandStringArrayPtr(d.Get("identifier_uris").([]interface{})),
ReplyUrls: tf.ExpandStringArrayPtr(d.Get("reply_urls").([]interface{})),
ReplyUrls: tf.ExpandStringArrayPtr(d.Get("reply_urls").(*schema.Set).List()),
AvailableToOtherTenants: p.Bool(d.Get("available_to_other_tenants").(bool)),
RequiredResourceAccess: expandADApplicationRequiredResourceAccess(d),
}
Expand Down Expand Up @@ -167,7 +167,7 @@ func resourceApplicationUpdate(d *schema.ResourceData, meta interface{}) error {
}

if d.HasChange("reply_urls") {
properties.ReplyUrls = tf.ExpandStringArrayPtr(d.Get("reply_urls").([]interface{}))
properties.ReplyUrls = tf.ExpandStringArrayPtr(d.Get("reply_urls").(*schema.Set).List())
}

if d.HasChange("available_to_other_tenants") {
Expand Down
8 changes: 4 additions & 4 deletions azuread/resource_application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestAccAzureADApplication_update(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "identifier_uris.#", "1"),
resource.TestCheckResourceAttr(resourceName, "identifier_uris.0", fmt.Sprintf("http://%s.hashicorptest.com/00000000-0000-0000-0000-00000000", updatedId)),
resource.TestCheckResourceAttr(resourceName, "reply_urls.#", "1"),
resource.TestCheckResourceAttr(resourceName, "reply_urls.0", fmt.Sprintf("http://%s.hashicorptest.com", updatedId)),
resource.TestCheckResourceAttr(resourceName, "reply_urls.3714513888", "http://unittest.hashicorptest.com"),
resource.TestCheckResourceAttr(resourceName, "required_resource_access.#", "2"),
),
},
Expand Down Expand Up @@ -206,7 +206,7 @@ resource "azuread_application" "test" {
name = "acctest%s"
homepage = "https://homepage-%s"
identifier_uris = ["http://%s.hashicorptest.com/00000000-0000-0000-0000-00000000"]
reply_urls = ["http://%s.hashicorptest.com"]
reply_urls = ["http://unittest.hashicorptest.com"]
oauth2_allow_implicit_flow = true

required_resource_access {
Expand All @@ -221,7 +221,7 @@ resource "azuread_application" "test" {
id = "e1fe6dd8-ba31-4d61-89e7-88639da4683d"
type = "Scope"
}

resource_access {
id = "06da0dbc-49e2-44d2-8312-53f166ab848a"
type = "Scope"
Expand All @@ -237,5 +237,5 @@ resource "azuread_application" "test" {
}
}
}
`, id, id, id, id)
`, id, id, id)
}