컴파일 오류 삭제
Some checks failed
Deploy to OCIWP / deploy (push) Has been cancelled

This commit is contained in:
jade
2026-08-18 20:46:04 +09:00
parent b4ffac0cd5
commit c390b89250
2 changed files with 0 additions and 125 deletions

View File

@@ -1,38 +0,0 @@
package io.shinhanlife.dap.mcg.presentation;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.shinhanlife.dap.lib.mcp.security.SecurityProperties;
import io.shinhanlife.dap.lib.adapter.dto.JsonRpcResponse;
import io.shinhanlife.dap.mcg.config.GatewayFallbackProperties;
import io.shinhanlife.dap.mcg.registry.RedisRegistryService;
import io.shinhanlife.dap.mcg.service.ExecuteService;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.springframework.data.redis.RedisConnectionFailureException;
import org.springframework.http.ResponseEntity;
class McpRouterControllerTest {
@Test
void returnsEmptyToolListWhenRedisIsUnavailableAndNoFallbackIsConfigured() {
RedisRegistryService registryService = org.mockito.Mockito.mock(RedisRegistryService.class);
when(registryService.getAllTools()).thenThrow(new RedisConnectionFailureException("Redis unavailable"));
McpRouterController controller = new McpRouterController(
registryService,
org.mockito.Mockito.mock(ExecuteService.class),
org.mockito.Mockito.mock(SecurityProperties.class),
new ObjectMapper(),
new GatewayFallbackProperties());
ResponseEntity<JsonRpcResponse> response = assertDoesNotThrow(() -> controller.listTools(null));
Map<?, ?> result = (Map<?, ?>) response.getBody().getResult();
assertEquals(List.of(), result.get("tools"));
}
}