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 example for nginx module #2027

Merged
merged 5 commits into from Dec 27, 2019
Merged

Conversation

worldtiki
Copy link
Contributor

No description provided.


/**
* @author richardnorth
*/
public class SimpleNginxTest {

private static File contentFolder = new File(System.getProperty("user.home") + "/.tmp-test-container");
private static String tmpDirectory = System.getProperty("user.home") + "/.tmp-test-container";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to shift some things a bit to be able to include the test in the docs.

contentFolder.mkdir();
contentFolder.setReadable(true, false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find a reason why these were being set. I'm happy to put them back but for the purposes of a test/demo I don't think they are required.


URLConnection urlConnection = nginx.getBaseUrl("http", 80).openConnection();
private static String responseFromNginx(URL baseUrl) throws IOException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be done inline but I moved to a separate method to make the example more readable.

Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @worldtiki - this looks good to me!

@rnorth rnorth merged commit 3d79c03 into testcontainers:master Dec 27, 2019
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

2 participants