1818import org .springframework .core .io .ClassPathResource ;
1919import org .springframework .http .HttpStatus ;
2020
21+ import java .lang .reflect .Type ;
2122import java .nio .charset .Charset ;
2223import java .util .List ;
2324import java .util .Map ;
@@ -212,7 +213,7 @@ void find() {
212213 AccessCookieFilter accessCookieFilter = mockLoginFlow (MANAGE_SUB );
213214 Connection connection = connectionRepository .findById (seedIdentifiers .get (BUDDY_CHECK_PROD )).get ();
214215
215- Connection fetchedConnection = given ()
216+ Map < String , Map < String , Object >> data = given ()
216217 .when ()
217218 .filter (accessCookieFilter .cookieFilter ())
218219 .header (csrfHeader (accessCookieFilter ))
@@ -221,9 +222,10 @@ void find() {
221222 .pathParam ("manageType" , connection .getProtocol ())
222223 .pathParam ("manageIdentifier" , connection .getManageIdentifier ())
223224 .get ("/api/v1/connections/{manageType}/{manageIdentifier}" )
224- .as (Connection .class );
225+ .as (new TypeRef <>() {
226+ });
225227
226- assertEquals (connection .getId (), fetchedConnection . getId ( ));
228+ assertEquals (connection .getId (). intValue (), data . get ( "connection" ). get ( "id" ));
227229 }
228230
229231 @ Test
@@ -237,7 +239,7 @@ void find404() {
237239 .contentType (ContentType .JSON )
238240 .pathParam ("manageType" , EntityType .oidc10_rp )
239241 .pathParam ("manageIdentifier" , "nope" )
240- .get ("/api/v1/connections" )
242+ .get ("/api/v1/connections/{manageType}/{manageIdentifier} " )
241243 .then ()
242244 .statusCode (HttpStatus .NOT_FOUND .value ());
243245
0 commit comments