Skip to content

microservices#2

Merged
munuprig merged 49 commits into
mainfrom
microservices
Jun 1, 2026
Merged

microservices#2
munuprig merged 49 commits into
mainfrom
microservices

Conversation

@munuprig

Copy link
Copy Markdown
Owner

No description provided.

Comment thread core/event-service/src/main/java/ru/practicum/comment/model/Comment.java Outdated
Comment thread core/event-service/src/main/java/ru/practicum/event/service/EventServiceImpl.java Outdated
Comment thread core/event-service/pom.xml Outdated
Comment thread core/interaction-api/pom.xml Outdated
@munuprig munuprig force-pushed the microservices branch 5 times, most recently from b7e1e9c to 0f9ede8 Compare May 31, 2026 05:01

@kesch9 kesch9 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Подправлено не до конца

@munuprig

Copy link
Copy Markdown
Owner Author

У меня уже кончились идеи, почему так происходит. Один тест не хочет проходиться ни в какую. Я понимаю, что это будет уже четвертая попытка. Прошу вас помочь мне хотя бы понять, в чем дело, буду вам очень благодарен!

.onStatus(status -> status != HttpStatus.OK, (request, response) -> {
throw new InvalidRequestException(response.getStatusCode().value() + ": " + response.getBody());
})
.body(ParameterizedTypeReference.forType(List.class));

@kesch9 kesch9 Jun 1, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У вас в логах ошибка каста

{"status":"INTERNAL_SERVER_ERROR","reason":"internal s
  │ erver error","message":"java.lang.ClassCastException: 
  │ class java.util.LinkedHashMap cannot be cast to class 
  │ ru.practicum.ViewStats (java.util.LinkedHashMap is in 
  │ module java.base of loader 'bootstrap'; ru.practicum.V
  │ iewStats is in unnamed module of loader org.springfram

Она возникает в этом месте
здесь нужно указать
.body(new ParameterizedTypeReference<List<ViewStats>>() {});

ParameterizedTypeReference.forType(List.class) теряет generic информацию, поэтому JSON десериализуется в List, а не List.

@kesch9 kesch9 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve

@munuprig munuprig merged commit d255a94 into main Jun 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants