@@ -65,7 +65,7 @@ defmodule Diffo.InstanceExtension.AssignerTest do
6565 encoding = Jason . encode! ( card ) |> Diffo.Util . summarise_dates ( )
6666
6767 assert encoding ==
68- ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{}},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :1,\" free\" :1,\" algorithm\" :\" lowest\" }}]})
68+ ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" description \" : \" A Card Resource Instance \" , \" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{}},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :1,\" free\" :1,\" algorithm\" :\" lowest\" }}]})
6969 end
7070
7171 test "define card" do
@@ -81,7 +81,7 @@ defmodule Diffo.InstanceExtension.AssignerTest do
8181 encoding = Jason . encode! ( card ) |> Diffo.Util . summarise_dates ( )
8282
8383 assert encoding ==
84- ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :48,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
84+ ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" description \" : \" A Card Resource Instance \" , \" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :48,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
8585 end
8686
8787 test "auto assign port to resource" do
@@ -106,7 +106,7 @@ defmodule Diffo.InstanceExtension.AssignerTest do
106106 encoding = Jason . encode! ( card ) |> Diffo.Util . summarise_dates ( )
107107
108108 assert encoding ==
109- ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceRelationship\" :[{\" type\" :\" assignedTo\" ,\" resource\" :{\" id\" :\" #{ assignee . id } \" ,\" href\" :\" resourceInventoryManagement/v4/resource/#{ assignee . id } \" },\" resourceRelationshipCharacteristic\" :[{\" name\" :\" port\" ,\" value\" :1}]}],\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :47,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
109+ ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" description \" : \" A Card Resource Instance \" , \" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceRelationship\" :[{\" type\" :\" assignedTo\" ,\" resource\" :{\" id\" :\" #{ assignee . id } \" ,\" href\" :\" resourceInventoryManagement/v4/resource/#{ assignee . id } \" },\" resourceRelationshipCharacteristic\" :[{\" name\" :\" port\" ,\" value\" :1}]}],\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :47,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
110110 end
111111
112112 test "auto assign two ports to same resource" do
@@ -136,7 +136,7 @@ defmodule Diffo.InstanceExtension.AssignerTest do
136136 encoding = Jason . encode! ( card ) |> Diffo.Util . summarise_dates ( )
137137
138138 assert encoding ==
139- ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceRelationship\" :[{\" type\" :\" assignedTo\" ,\" resource\" :{\" id\" :\" #{ assignee . id } \" ,\" href\" :\" resourceInventoryManagement/v4/resource/#{ assignee . id } \" },\" resourceRelationshipCharacteristic\" :[{\" name\" :\" port\" ,\" value\" :1}]},{\" type\" :\" assignedTo\" ,\" resource\" :{\" id\" :\" #{ assignee . id } \" ,\" href\" :\" resourceInventoryManagement/v4/resource/#{ assignee . id } \" },\" resourceRelationshipCharacteristic\" :[{\" name\" :\" port\" ,\" value\" :2}]}],\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :46,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
139+ ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" description\" :\" A Card Resource Instance\" ,\" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceRelationship\" :[{\" type\" :\" assignedTo\" ,\" resource\" :{\" id\" :\" #{ assignee . id } \" ,\" href\" :\" resourceInventoryManagement/v4/resource/#{ assignee . id } \" },\" resourceRelationshipCharacteristic\" :[{\" name\" :\" port\" ,\" value\" :1}]},{\" type\" :\" assignedTo\" ,\" resource\" :{\" id\" :\" #{ assignee . id } \" ,\" href\" :\" resourceInventoryManagement/v4/resource/#{ assignee . id } \" },\" resourceRelationshipCharacteristic\" :[{\" name\" :\" port\" ,\" value\" :2}]}],\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :46,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
140140 end
141141
142142 test "specific assignment rejects duplicate request" do
@@ -166,7 +166,7 @@ defmodule Diffo.InstanceExtension.AssignerTest do
166166 encoding = Jason . encode! ( card ) |> Diffo.Util . summarise_dates ( )
167167
168168 assert encoding ==
169- ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceRelationship\" :[{\" type\" :\" assignedTo\" ,\" resource\" :{\" id\" :\" #{ assignee . id } \" ,\" href\" :\" resourceInventoryManagement/v4/resource/#{ assignee . id } \" },\" resourceRelationshipCharacteristic\" :[{\" name\" :\" port\" ,\" value\" :5}]}],\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :47,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
169+ ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" description \" : \" A Card Resource Instance \" , \" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceRelationship\" :[{\" type\" :\" assignedTo\" ,\" resource\" :{\" id\" :\" #{ assignee . id } \" ,\" href\" :\" resourceInventoryManagement/v4/resource/#{ assignee . id } \" },\" resourceRelationshipCharacteristic\" :[{\" name\" :\" port\" ,\" value\" :5}]}],\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :47,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
170170 end
171171
172172 test "unassign an auto-assigned port from a resource" do
@@ -209,7 +209,7 @@ defmodule Diffo.InstanceExtension.AssignerTest do
209209 encoding = Jason . encode! ( card ) |> Diffo.Util . summarise_dates ( )
210210
211211 assert encoding ==
212- ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :48,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
212+ ~s( {\" id\" :\" #{ card . id } ",\" href\" :\" resourceInventoryManagement/v4/resource/#{ card . id } ",\" category\" :\" Network Resource\" ,\" description \" : \" A Card Resource Instance \" , \" resourceSpecification\" :{\" id\" :\" cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" href\" :\" resourceCatalogManagement/v4/resourceSpecification/cd29956f-6c68-44cc-bf54-705eb8d2f754\" ,\" name\" :\" card\" ,\" version\" :\" v1.0.0\" },\" resourceCharacteristic\" :[{\" name\" :\" card\" ,\" value\" :{\" family\" :\" ISAM\" ,\" model\" :\" EBLT48\" ,\" technology\" :\" adsl2Plus\" }},{\" name\" :\" ports\" ,\" value\" :{\" first\" :1,\" last\" :48,\" free\" :48,\" type\" :\" ADSL2+\" ,\" algorithm\" :\" lowest\" }}]})
213213 end
214214 end
215215end
0 commit comments