@@ -38,7 +38,7 @@ void setup() {
3838 }
3939 """ .formatted (NAME , EMAIL , PASSWORD );
4040
41- client .exchange ("https ://jpa-1-bo8z.onrender.com /api/auth/register" ,
41+ client .exchange ("http ://localhost:8080 /api/auth/register" ,
4242 HttpMethod .POST , new HttpEntity <>(json , headers ), String .class );
4343
4444 // 2. Login
@@ -49,7 +49,7 @@ void setup() {
4949 }
5050 """ .formatted (EMAIL , PASSWORD );
5151
52- ResponseEntity <String > response = client .exchange ("https ://jpa-1-bo8z.onrender.com /api/auth/login" ,
52+ ResponseEntity <String > response = client .exchange ("http ://localhost:8080 /api/auth/login" ,
5353 HttpMethod .POST , new HttpEntity <>(loginJson , headers ), String .class );
5454
5555 // 3. Captura la cookie de sesión
@@ -61,7 +61,7 @@ void setup() {
6161 @ Test
6262 public void getMe_returnsUserInfo () {
6363 ResponseEntity <String > response = client .exchange (
64- "https ://jpa-1-bo8z.onrender.com /api/auth/me" ,
64+ "http ://localhost:8080 /api/auth/me" ,
6565 HttpMethod .GET ,
6666 new HttpEntity <>(null , cookieHeaders ),
6767 String .class
@@ -74,7 +74,7 @@ public void getMe_returnsUserInfo() {
7474 @ Test
7575 public void logout_removesSession () {
7676 ResponseEntity <String > response = client .exchange (
77- "https ://jpa-1-bo8z.onrender.com /api/auth/logout" ,
77+ "http ://localhost:8080 /api/auth/logout" ,
7878 HttpMethod .POST ,
7979 new HttpEntity <>(null , cookieHeaders ),
8080 String .class
@@ -87,7 +87,7 @@ public void logout_removesSession() {
8787 public void getMe_withoutLogin_returnsUnauthorized () {
8888 // No incluimos la cookie de sesión
8989 ResponseEntity <String > response = client .exchange (
90- "https ://jpa-1-bo8z.onrender.com /api/auth/me" ,
90+ "http ://localhost:8080 /api/auth/me" ,
9191 HttpMethod .GET ,
9292 new HttpEntity <>(null , new HttpHeaders ()), // sin cookies
9393 String .class
@@ -100,15 +100,15 @@ public void getMe_withoutLogin_returnsUnauthorized() {
100100 public void logout_thenGetMe_returnsUnauthorized () {
101101 // 1. Hacemos logout
102102 client .exchange (
103- "https ://jpa-1-bo8z.onrender.com /api/auth/logout" ,
103+ "http ://localhost:8080 /api/auth/logout" ,
104104 HttpMethod .POST ,
105105 new HttpEntity <>(null , cookieHeaders ),
106106 String .class
107107 );
108108
109109 // 2. Intentamos acceder a /me con la cookie antigua
110110 ResponseEntity <String > response = client .exchange (
111- "https ://jpa-1-bo8z.onrender.com /api/auth/me" ,
111+ "http ://localhost:8080 /api/auth/me" ,
112112 HttpMethod .GET ,
113113 new HttpEntity <>(null , cookieHeaders ),
114114 String .class
@@ -132,7 +132,7 @@ public void login_withCorrectCredentials_returnsSessionCookie() {
132132 HttpEntity <String > request = new HttpEntity <>(loginJson , headers );
133133
134134 ResponseEntity <String > response = client .postForEntity (
135- "https ://jpa-1-bo8z.onrender.com /api/auth/login" ,
135+ "http ://localhost:8080 /api/auth/login" ,
136136 request ,
137137 String .class
138138 );
0 commit comments