test(restapi): drop /swagger-ui from 404 test (env-dependent)

Failed pipeline 6805: /swagger-ui/index.html в test profile вернул 200
(springdoc enabled по умолчанию через ORDINIS_SWAGGER_UI_ENABLED default
true). Это валидно — Swagger render'ит реальную UI page.

Замена: проверяем generic non-API typo path который точно не имеет
controller'а и не SPA-route'д. Покрывает тот же NoResourceFoundException
branch handler'а независимо от springdoc env config.
This commit is contained in:
Zimin A.N.
2026-05-13 00:07:17 +03:00
parent f2adc37e2e
commit 000322d6ee
@@ -141,8 +141,9 @@ class SmokeE2ETest {
* debugging без traceId correlation.</li> * debugging без traceId correlation.</li>
* </ul> * </ul>
* *
* <p>Покрывает оба пути: путь похожий на API ({@code /api/v1/notexist}) и * <p>Тест проверяет API-typo путь — он независим от env (springdoc может
* generic non-API ({@code /random/path}). * быть enabled/disabled, не влияет). Проверка swagger-ui→404 при disabled
* springdoc относится к prod integration, не к unit-уровню handler'а.
*/ */
@Test @Test
void unknownPath_returns404WithNotFoundCode() throws Exception { void unknownPath_returns404WithNotFoundCode() throws Exception {
@@ -151,7 +152,9 @@ class SmokeE2ETest {
.andExpect(jsonPath("$.status").value(404)) .andExpect(jsonPath("$.status").value(404))
.andExpect(jsonPath("$.code").value("not_found")); .andExpect(jsonPath("$.code").value("not_found"));
mvc.perform(get("/swagger-ui/index.html")) // Generic non-API typo тоже должен 404'нуться (covers static resource
// fallback branch NoResourceFoundException — этот путь не SPA-routed).
mvc.perform(get("/totally-bogus-path-xyz-12345.unknown"))
.andExpect(status().isNotFound()) .andExpect(status().isNotFound())
.andExpect(jsonPath("$.status").value(404)) .andExpect(jsonPath("$.status").value(404))
.andExpect(jsonPath("$.code").value("not_found")); .andExpect(jsonPath("$.code").value("not_found"));