N
N
nuclear_kote2021-06-21 16:05:53
Java
nuclear_kote, 2021-06-21 16:05:53

How to dunk bean before ContextRefreshedEvent?

in general, you need to test a service that has

@EventListener
    public void handleContextRefresh(ContextRefreshedEvent event) {

such a thing and this thing uses RestTemplate. @BeforeEach fulfills already after @EventListener'a. actually the question is how to get around it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2021-06-21
@nuclear_kote

I'd rather make a mock http server (MockServer) that RestTemplate accesses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question