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

Add QuarkusProdModeTest start/stop methods and fix restassured random port #15073

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

Sgitario
Copy link
Contributor

These changes allow to use QuarkusProdModeTest to cope with more complex test scenarios like failover cases. Example:

@RegisterExtension
static final QuarkusProdModeTest nodeApp = new QuartzNodeApplicationResource();

@RegisterExtension
static final QuarkusProdModeTest masterApp = new QuartzMasterApplicationResource();

@Test
public void testFailover() {
    assertMasterIsConnectedWithNode();

    // simulate node failover
    nodeApp.stop();
    assertMasterIsNotConnectedWithNode();

    nodeApp.start();
    assertMasterIsConnectedWithNode();
}

Also, about the rest assured, when we want to start our Quarkus application using a random port (quarkus.http.port=0), the QuarkusProdModeTest is setting RestAssured.defaultPort = 0 which is invalid (if you try to do given() in your test case, you will get an exception.

Fix #14961

@quarkus-bot
Copy link

quarkus-bot bot commented Feb 15, 2021

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

title should not end up with ellipsis (make sure the title is complete)

This message is automatically generated by a bot.

@Sgitario Sgitario changed the title Add QuarkusProdModeTest start/stop methods and fix restassured integr… Add QuarkusProdModeTest start/stop methods and fix restassured random port Feb 15, 2021
@geoand geoand merged commit 2cccb28 into quarkusio:master Feb 17, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Feb 17, 2021
@Sgitario Sgitario deleted the start_stop_prod branch February 17, 2021 09:52
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.

Add start/stop methods for QuarkusProdModeTest and do not setup RestAssured.port if it's configured randomly
3 participants