Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct api base name in kafkaResourceIT reactive tests #15305

Conversation

iconben
Copy link
Contributor

@iconben iconben commented Jun 11, 2021

When generating a reactive service (e.g. gateway), api base name in KafkaResourceIT tests does not match the actual api base name, which leads to integration tests fail eventually.

In generated Resource class, api is:

@RestController
@RequestMapping("/api/<%= dasherizedBaseName %>-kafka")
public class <%= upperFirstCamelCase(baseName) %>KafkaResource {

    @PostMapping("/publish/{topic}")
    public ........

in generated rest tests, it was :

    @Test
    void producesMessages()<% if (!reactive) { %> throws Exception<% } %> {
        <%_ if (!reactive) { _%>
        restMockMvc.perform(post("/api/<%= dasherizedBaseName %>-kafka/publish/topic-produce?message=value-produce"))
            .andExpect(status().isOk())
            .andExpect(content().contentType(MediaType.APPLICATION_JSON));
        <%_ } else { _%>
        client.post().uri("/api/jhipster-kafka/publish/topic-produce?message=value-produce")
            .exchange()
            .expectStatus().isOk()
            .expectHeader().contentType(MediaType.APPLICATION_JSON);
        <%_ } _%>
        ......
    }

When non-reactive, the api path is right though. The path should be nothing to do with if reactive or not.


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@iconben iconben changed the title Correct api path in kafkaResourceIT when reactive Correct api base name in kafkaResourceIT reactive tests Jun 11, 2021
@DanielFran
Copy link
Member

Thanks @iconben for the contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants