UPDATE 10-sept

This commit is contained in:
PAVEL PALMA
2025-09-10 10:24:55 -06:00
parent 11888d2632
commit 9b1824bc48
15 changed files with 582 additions and 234 deletions

View File

@@ -0,0 +1,51 @@
package com.example.service.integration_testing;
import com.example.service.base.NotificationContextResolver;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@SpringBootTest
@ActiveProfiles("dev")
@DisplayName("NotificationContextResolver Live Tests")
public class NotificationContextResolverLiveTest {
private String notificationsJson;
private String conversationJson;
private String queryInputText;
private String metadataJson;
@Autowired
private NotificationContextResolver notificationContextResolver;
@BeforeEach
void setUp() {
notificationsJson = "Hola :\n" +
"Pasó algo con la captura de tu INE y no se completó tu *solicitud de tarjeta de crédito con folio *.\n"
+
"¡Reinténtalo cuando quieras! Solo toma en cuenta estos consejos:\n" +
"🪪 Presenta tu INE original (no copias ni escaneos).\n" +
"📅Revisa que esté vigente y sin tachaduras.\n" +
"📷 Confirma que la fotografía sea clara.\n" +
"🏠 Asegúrate de que la dirección sea legible.\n" +
"Estamos listos para recibirte.\n";
conversationJson = "{}";
queryInputText = "necesito saber el id de la campaña";
metadataJson = "{\"contexto\":\"campañaprueba\",\"id_aplicacion\":\"TestSigma\",\"id_campaña\":\"campaña01\",\"id_notificacion\":\"Prueba2\",\"vigencia\":\"30/09/2025\"}";
}
@Test
@DisplayName("Should get live response from LLM and print it")
public void shouldGetLiveResponseFromLlmAndPrintIt() {
String result = notificationContextResolver.resolveContext(queryInputText, notificationsJson, conversationJson,
metadataJson, "test_user", "test_session", "1234567890");
System.out.println("Live LLM Response: " + result);
assertNotNull(result);
}
}