Skip to content

Commit

Permalink
Fixed existing system register test that was not working and added nu…
Browse files Browse the repository at this point in the history
…ll check for allowredirecturl
  • Loading branch information
acn-dgopa committed Dec 12, 2024
1 parent 7be2a21 commit bd3b7e0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ private static ValueTask<RegisteredSystem> ConvertFromReaderToSystemRegister(Npg
ClientId = clientIds,
Rights = rights,
IsVisible = reader.GetFieldValue<bool>("is_visible"),
AllowedRedirectUrls = reader.GetFieldValue<List<string>>("allowedredirecturls").ConvertAll<Uri>(delegate (string u) { return new Uri(u); })
AllowedRedirectUrls = reader.IsDBNull("allowedredirecturls") ? null : reader.GetFieldValue<List<string>>("allowedredirecturls")?.ConvertAll<Uri>(delegate (string u) { return new Uri(u); })
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public async Task SystemRegister_Get_ListofAll()

HttpRequestMessage request = new(HttpMethod.Get, $"/authentication/api/v1/systemregister");
HttpResponseMessage getAllResponse = await client.SendAsync(request, HttpCompletionOption.ResponseContentRead);
List<RegisteredSystem> list = JsonSerializer.Deserialize<List<RegisteredSystem>>(await getAllResponse.Content.ReadAsStringAsync(), _options);
List<RegisteredSystemDTO> list = JsonSerializer.Deserialize<List<RegisteredSystemDTO>>(await getAllResponse.Content.ReadAsStringAsync(), _options);
Assert.True(list.Count > 1);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
{
"systemId": "991825827_the_matrix_01",
"systemVendorOrgNumber": "991825827",
"systemName": "The Matrix 001",
"id": "991825827_the_matrix_01",
"vendor": {
"authority": "iso6523-actorid-upis",
"ID": "0192:991825827"
},
"name": {
"nb": "The Matrix",
"en": "The Matrix",
"nn": "The Matrix"
},
"description": {
"nb": "Test system",
"en": "Test system",
"nn": "Test system"
},
"rights": [
{
"resource": [
{
"id": "urn:altinn:resource",
"value": "ske_krav-og-betaling"
"value": "ske-krav-og-betalinger"
}
]
}
],
"softDeleted": false,
"clientId": [
"32ef65ac-6e62-498d-880f-76c85c2052ae"
"32ef65ac-6e62-498d-880f-76c85c2052af"
],
"isVisible": true
}

0 comments on commit bd3b7e0

Please sign in to comment.