@@ -51,6 +51,8 @@ public class ClientApplicationServiceTest {
5151 public static final Application DTO = new Application ()
5252 .id (UUID .randomUUID ())
5353 .name ("App Name" )
54+ .relyingPartyHostname ("example.com" )
55+ .relyingPartyName ("Example App" )
5456 .createdAt (Instant .now ())
5557 .updatedAt (Instant .now ());
5658
@@ -79,6 +81,8 @@ public void addClientApplicationTest() {
7981 // Execute
8082 AddApplicationRequest addApplicationRequest = new AddApplicationRequest ();
8183 addApplicationRequest .setName (DTO .getName ());
84+ addApplicationRequest .setRelyingPartyHostname (DTO .getRelyingPartyHostname ());
85+ addApplicationRequest .setRelyingPartyName (DTO .getRelyingPartyName ());
8286 Application result = service .add (addApplicationRequest );
8387
8488 // Capture the argument
@@ -89,6 +93,8 @@ public void addClientApplicationTest() {
8993 assertFalse (savedClientApplication .getApiKey ().isEmpty ());
9094 assertEquals (DTO .getName (), savedClientApplication .getName ());
9195 assertEquals (DTO .getName (), result .getName ());
96+ assertEquals (DTO .getRelyingPartyHostname (), savedClientApplication .getRelyingPartyHostname ());
97+ assertEquals (DTO .getRelyingPartyName (), savedClientApplication .getRelyingPartyName ());
9298 }
9399
94100 @ Test
@@ -103,8 +109,8 @@ public void listAllClientApplicationsTest() {
103109 // Validate
104110 assertNotNull (result );
105111 assertEquals (1 , result .size ());
106- assertEquals (DTO .getId (), result .get ( 0 ).getId ());
107- assertEquals (DTO .getName (), result .get ( 0 ).getName ());
112+ assertEquals (DTO .getId (), result .getFirst ( ).getId ());
113+ assertEquals (DTO .getName (), result .getFirst ( ).getName ());
108114 }
109115
110116 @ Test
@@ -115,6 +121,8 @@ public void editClientApplicationTest() {
115121 ClientApplication existingClientApplication = ClientApplication .builder ()
116122 .id (id )
117123 .name ("Old Name" )
124+ .relyingPartyHostname ("example.com" )
125+ .relyingPartyName ("Example RP" )
118126 .createdAt (Instant .now ())
119127 .updatedAt (Instant .now ())
120128 .build ();
@@ -125,11 +133,15 @@ public void editClientApplicationTest() {
125133 // Execute
126134 EditApplicationRequest editApplicationRequest = new EditApplicationRequest ();
127135 editApplicationRequest .setName (newName );
136+ editApplicationRequest .setRelyingPartyHostname ("example2.com" );
137+ editApplicationRequest .setRelyingPartyName ("Example RP 2" );
128138 Optional <Application > result = service .edit (id , editApplicationRequest );
129139
130140 // Validate
131141 assertTrue (result .isPresent ());
132142 assertEquals (newName , result .get ().getName ());
143+ assertEquals (editApplicationRequest .getRelyingPartyHostname (), result .get ().getRelyingPartyHostname ());
144+ assertEquals (editApplicationRequest .getRelyingPartyName (), result .get ().getRelyingPartyName ());
133145 }
134146
135147 @ Test
0 commit comments