@@ -470,27 +470,12 @@ func TestIntegration_MappingAPI(t *testing.T) {
470470 }
471471
472472 // Retrieve mapping
473- resp , body , err = doRequest ("GET" , baseURL + "/api/internal/map_number_to_matrix?number=%2B9998887777 " , nil , headers )
473+ resp , body , err = doRequest ("GET" , baseURL + "/api/internal/map_number_to_matrix?number=9998887777 " , nil , headers )
474474 if err != nil {
475475 t .Fatalf ("request failed: %v" , err )
476476 }
477477 if resp .StatusCode != http .StatusOK {
478- t .Logf ("get mapping returned non-200 status; got %d: %s" , resp .StatusCode , string (body ))
479- if resp .StatusCode == http .StatusBadRequest {
480- if v , err := ensureMappingVariants (t , baseURL , cfg .adminToken , fmt .Sprintf ("%d" , mappingReq .Number ), mappingReq .MatrixID ); err == nil {
481- t .Logf ("created mapping variant %s for number %d" , v , mappingReq .Number )
482- // retry GET
483- resp , body , err = doRequest ("GET" , baseURL + "/api/internal/map_number_to_matrix?number=%2B9998887777" , nil , headers )
484- if err != nil {
485- t .Fatalf ("request failed: %v" , err )
486- }
487- } else {
488- t .Skip ("mapping not found and creation attempts failed; skipping assertion" )
489- }
490- }
491- if resp .StatusCode != http .StatusOK {
492- t .Fatalf ("unexpected status code %d: %s" , resp .StatusCode , string (body ))
493- }
478+ t .Fatalf ("get mapping returned non-200 status; got %d: %s" , resp .StatusCode , string (body ))
494479 }
495480
496481 var mappingResp models.MappingResponse
@@ -533,25 +518,13 @@ func TestIntegration_MappingAPI(t *testing.T) {
533518 }
534519
535520 // Retrieve mapping and check user_name
536- resp , body , err = doRequest ("GET" , baseURL + "/api/internal/map_number_to_matrix?number=%2B1234509876 " , nil , headers )
521+ resp , body , err = doRequest ("GET" , baseURL + "/api/internal/map_number_to_matrix?number=1234509876 " , nil , headers )
537522 if err != nil {
538523 t .Fatalf ("request failed: %v" , err )
539524 }
540525 if resp .StatusCode != http .StatusOK {
541- if resp .StatusCode == http .StatusBadRequest {
542- if _ , err := ensureMappingVariants (t , baseURL , cfg .adminToken , fmt .Sprintf ("%d" , mappingReq .Number ), mappingReq .MatrixID ); err == nil {
543- // retry GET
544- resp , body , err = doRequest ("GET" , baseURL + "/api/internal/map_number_to_matrix?number=%2B1234509876" , nil , headers )
545- if err != nil {
546- t .Fatalf ("request failed: %v" , err )
547- }
548- } else {
549- t .Skip ("mapping not found and creation attempts failed; skipping assertion" )
550- }
551- }
552- if resp .StatusCode != http .StatusOK {
553- t .Fatalf ("unexpected status code %d: %s" , resp .StatusCode , string (body ))
554- }
526+ t .Fatalf ("unexpected status code %d: %s" , resp .StatusCode , string (body ))
527+
555528 }
556529
557530 var mappingResp models.MappingResponse
@@ -658,7 +631,7 @@ func TestIntegration_SendMessageWithPhoneNumberMapping(t *testing.T) {
658631 }
659632
660633 // Create a direct room between user1 and user2 using CreateDirectRoom
661- aliasKey := fmt .Sprintf ("%s|%s " , user1Localpart , user2Localpart )
634+ aliasKey := fmt .Sprintf ("%s_bis|%s_bis " , user1Localpart , user2Localpart )
662635 createResp , err := matrixClient .CreateDirectRoom (context .Background (), id .UserID (user1MatrixID ), id .UserID (user2MatrixID ), aliasKey )
663636 if err != nil {
664637 t .Fatalf ("failed to create direct room: %v" , err )
0 commit comments