refs #737: align MCP tests with game planning tools

This commit is contained in:
devmrko
2026-07-27 16:19:03 +09:00
parent f31292ecb3
commit 3cc033e4e6

View File

@@ -15,6 +15,8 @@ class McpSseServiceTest {
private final SelectAiService selectAiService = new CapturingSelectAiService(); private final SelectAiService selectAiService = new CapturingSelectAiService();
private final QaVectorService qaVectorService = new CapturingQaVectorService(); private final QaVectorService qaVectorService = new CapturingQaVectorService();
private final GameScopeService gameScopeService = new CapturingGameScopeService(); private final GameScopeService gameScopeService = new CapturingGameScopeService();
private final GameCatalogVectorService gameCatalogVectorService =
new CapturingGameCatalogVectorService();
private final McpSseService service = new McpSseService( private final McpSseService service = new McpSseService(
selectAiService, selectAiService,
objectMapper, objectMapper,
@@ -48,7 +50,8 @@ class McpSseServiceTest {
"테스트 DB 게임 범위 확인 도구입니다." "테스트 DB 게임 범위 확인 도구입니다."
), ),
qaVectorService, qaVectorService,
gameScopeService gameScopeService,
gameCatalogVectorService
); );
@Test @Test
@@ -56,7 +59,7 @@ class McpSseServiceTest {
ObjectNode response = service.handle("default", request(1, "tools/list")); ObjectNode response = service.handle("default", request(1, "tools/list"));
var tools = response.path("result").path("tools"); var tools = response.path("result").path("tools");
assertThat(tools).hasSize(6); assertThat(tools).hasSize(8);
var selectAi = tools.get(0); var selectAi = tools.get(0);
assertThat(selectAi.path("name").asText()).isEqualTo("oracle.select_ai.test_data_text2sql"); assertThat(selectAi.path("name").asText()).isEqualTo("oracle.select_ai.test_data_text2sql");
assertThat(selectAi.path("description").asText()).contains("SGMP_POC_OCI_GPT54MINI"); assertThat(selectAi.path("description").asText()).contains("SGMP_POC_OCI_GPT54MINI");
@@ -102,6 +105,11 @@ class McpSseServiceTest {
.isEqualTo("oracle.select_ai.test_game_scope_resolve"); .isEqualTo("oracle.select_ai.test_game_scope_resolve");
assertThat(gameScope.path("inputSchema").path("required")) assertThat(gameScope.path("inputSchema").path("required"))
.extracting(node -> node.asText()).contains("question"); .extracting(node -> node.asText()).contains("question");
assertThat(tools.get(6).path("name").asText())
.isEqualTo("oracle.select_ai.game_catalog_resolve");
assertThat(tools.get(7).path("name").asText())
.isEqualTo("oracle.select_ai.game_query_plan");
} }
@Test @Test
@@ -252,7 +260,7 @@ class McpSseServiceTest {
private boolean showpromptCalled; private boolean showpromptCalled;
private CapturingSelectAiService() { private CapturingSelectAiService() {
super(null, null, null, new ObjectMapper(), null, null); super(null, null, null, new ObjectMapper(), null, null, null);
} }
@Override @Override
@@ -333,4 +341,24 @@ class McpSseServiceTest {
)); ));
} }
} }
private static final class CapturingGameCatalogVectorService
extends GameCatalogVectorService {
private CapturingGameCatalogVectorService() {
super(null, null, new ObjectMapper());
}
@Override
public Resolution resolve(String token, String question, int topK) {
return new Resolution("SINGLE_GAME", java.util.List.of(new GameCandidate(
"SUPPORTED_GAME",
"SUPPORTED_GAME_ID",
"SUPPORTED_PREFIX",
"Supported game",
"Supported",
0.1
)));
}
}
} }