Testing multiple servers with spring boot test









up vote
0
down vote

favorite












I have a multi-module maven project with a spring service in each module.
The problem I have is that I want to create a test with multiple servers.



So currently I have a couple of tests that are actually starting a server and doing some requests to it using the annotation @SpringBootTest. And preferably I would like to test multiple servers with the same approach as it gives me the opportunity to mock for example the database connections. And I can of course mock parts of the HTTP calls if needed so that the servers can "communicate".



So I guess the question is:
Is it possible to test multiple servers in this way?










share|improve this question





















  • The question which comes into my mind: What kind of tests are you doing if you start servers etc. ? Furthermore in such cases I would suggest to take a look at testcontainers.org
    – khmarbaise
    Nov 9 at 8:36










  • The tests that I have right now are testing the flow between components inside one server. But there is nothing that tests that the servers are communicating properly with eachother(there are no clear requirements so we don't know what is working and what isn't). The issue with testcontainers.org is that I don't seem to be able to mock the contents of the database. We are using oracle with a bunch of tables, views and procedures making it quite difficult to setup in a test docker environment
    – munHunger
    Nov 9 at 8:42










  • Than I don't understand the part: The problem I have is that I want to create a test with multiple servers....
    – khmarbaise
    Nov 9 at 8:53










  • You're talking about a full integration test, and the way that's usually done is to have some sort of management software (e.g., Spinnaker) that deploys the different components and then runs the tests externally, making remote calls like a normal client would.
    – chrylis
    Nov 9 at 8:54










  • hmm, ok, to clarify I have a database A and two servers B and C. Both B and C communicates with A, but A is to complex to start and thus I need to mock it. What I want to test is that B can send propper requests to C.
    – munHunger
    Nov 9 at 8:57














up vote
0
down vote

favorite












I have a multi-module maven project with a spring service in each module.
The problem I have is that I want to create a test with multiple servers.



So currently I have a couple of tests that are actually starting a server and doing some requests to it using the annotation @SpringBootTest. And preferably I would like to test multiple servers with the same approach as it gives me the opportunity to mock for example the database connections. And I can of course mock parts of the HTTP calls if needed so that the servers can "communicate".



So I guess the question is:
Is it possible to test multiple servers in this way?










share|improve this question





















  • The question which comes into my mind: What kind of tests are you doing if you start servers etc. ? Furthermore in such cases I would suggest to take a look at testcontainers.org
    – khmarbaise
    Nov 9 at 8:36










  • The tests that I have right now are testing the flow between components inside one server. But there is nothing that tests that the servers are communicating properly with eachother(there are no clear requirements so we don't know what is working and what isn't). The issue with testcontainers.org is that I don't seem to be able to mock the contents of the database. We are using oracle with a bunch of tables, views and procedures making it quite difficult to setup in a test docker environment
    – munHunger
    Nov 9 at 8:42










  • Than I don't understand the part: The problem I have is that I want to create a test with multiple servers....
    – khmarbaise
    Nov 9 at 8:53










  • You're talking about a full integration test, and the way that's usually done is to have some sort of management software (e.g., Spinnaker) that deploys the different components and then runs the tests externally, making remote calls like a normal client would.
    – chrylis
    Nov 9 at 8:54










  • hmm, ok, to clarify I have a database A and two servers B and C. Both B and C communicates with A, but A is to complex to start and thus I need to mock it. What I want to test is that B can send propper requests to C.
    – munHunger
    Nov 9 at 8:57












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a multi-module maven project with a spring service in each module.
The problem I have is that I want to create a test with multiple servers.



So currently I have a couple of tests that are actually starting a server and doing some requests to it using the annotation @SpringBootTest. And preferably I would like to test multiple servers with the same approach as it gives me the opportunity to mock for example the database connections. And I can of course mock parts of the HTTP calls if needed so that the servers can "communicate".



So I guess the question is:
Is it possible to test multiple servers in this way?










share|improve this question













I have a multi-module maven project with a spring service in each module.
The problem I have is that I want to create a test with multiple servers.



So currently I have a couple of tests that are actually starting a server and doing some requests to it using the annotation @SpringBootTest. And preferably I would like to test multiple servers with the same approach as it gives me the opportunity to mock for example the database connections. And I can of course mock parts of the HTTP calls if needed so that the servers can "communicate".



So I guess the question is:
Is it possible to test multiple servers in this way?







java spring maven testing spring-boot-test






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 at 8:32









munHunger

414315




414315











  • The question which comes into my mind: What kind of tests are you doing if you start servers etc. ? Furthermore in such cases I would suggest to take a look at testcontainers.org
    – khmarbaise
    Nov 9 at 8:36










  • The tests that I have right now are testing the flow between components inside one server. But there is nothing that tests that the servers are communicating properly with eachother(there are no clear requirements so we don't know what is working and what isn't). The issue with testcontainers.org is that I don't seem to be able to mock the contents of the database. We are using oracle with a bunch of tables, views and procedures making it quite difficult to setup in a test docker environment
    – munHunger
    Nov 9 at 8:42










  • Than I don't understand the part: The problem I have is that I want to create a test with multiple servers....
    – khmarbaise
    Nov 9 at 8:53










  • You're talking about a full integration test, and the way that's usually done is to have some sort of management software (e.g., Spinnaker) that deploys the different components and then runs the tests externally, making remote calls like a normal client would.
    – chrylis
    Nov 9 at 8:54










  • hmm, ok, to clarify I have a database A and two servers B and C. Both B and C communicates with A, but A is to complex to start and thus I need to mock it. What I want to test is that B can send propper requests to C.
    – munHunger
    Nov 9 at 8:57
















  • The question which comes into my mind: What kind of tests are you doing if you start servers etc. ? Furthermore in such cases I would suggest to take a look at testcontainers.org
    – khmarbaise
    Nov 9 at 8:36










  • The tests that I have right now are testing the flow between components inside one server. But there is nothing that tests that the servers are communicating properly with eachother(there are no clear requirements so we don't know what is working and what isn't). The issue with testcontainers.org is that I don't seem to be able to mock the contents of the database. We are using oracle with a bunch of tables, views and procedures making it quite difficult to setup in a test docker environment
    – munHunger
    Nov 9 at 8:42










  • Than I don't understand the part: The problem I have is that I want to create a test with multiple servers....
    – khmarbaise
    Nov 9 at 8:53










  • You're talking about a full integration test, and the way that's usually done is to have some sort of management software (e.g., Spinnaker) that deploys the different components and then runs the tests externally, making remote calls like a normal client would.
    – chrylis
    Nov 9 at 8:54










  • hmm, ok, to clarify I have a database A and two servers B and C. Both B and C communicates with A, but A is to complex to start and thus I need to mock it. What I want to test is that B can send propper requests to C.
    – munHunger
    Nov 9 at 8:57















The question which comes into my mind: What kind of tests are you doing if you start servers etc. ? Furthermore in such cases I would suggest to take a look at testcontainers.org
– khmarbaise
Nov 9 at 8:36




The question which comes into my mind: What kind of tests are you doing if you start servers etc. ? Furthermore in such cases I would suggest to take a look at testcontainers.org
– khmarbaise
Nov 9 at 8:36












The tests that I have right now are testing the flow between components inside one server. But there is nothing that tests that the servers are communicating properly with eachother(there are no clear requirements so we don't know what is working and what isn't). The issue with testcontainers.org is that I don't seem to be able to mock the contents of the database. We are using oracle with a bunch of tables, views and procedures making it quite difficult to setup in a test docker environment
– munHunger
Nov 9 at 8:42




The tests that I have right now are testing the flow between components inside one server. But there is nothing that tests that the servers are communicating properly with eachother(there are no clear requirements so we don't know what is working and what isn't). The issue with testcontainers.org is that I don't seem to be able to mock the contents of the database. We are using oracle with a bunch of tables, views and procedures making it quite difficult to setup in a test docker environment
– munHunger
Nov 9 at 8:42












Than I don't understand the part: The problem I have is that I want to create a test with multiple servers....
– khmarbaise
Nov 9 at 8:53




Than I don't understand the part: The problem I have is that I want to create a test with multiple servers....
– khmarbaise
Nov 9 at 8:53












You're talking about a full integration test, and the way that's usually done is to have some sort of management software (e.g., Spinnaker) that deploys the different components and then runs the tests externally, making remote calls like a normal client would.
– chrylis
Nov 9 at 8:54




You're talking about a full integration test, and the way that's usually done is to have some sort of management software (e.g., Spinnaker) that deploys the different components and then runs the tests externally, making remote calls like a normal client would.
– chrylis
Nov 9 at 8:54












hmm, ok, to clarify I have a database A and two servers B and C. Both B and C communicates with A, but A is to complex to start and thus I need to mock it. What I want to test is that B can send propper requests to C.
– munHunger
Nov 9 at 8:57




hmm, ok, to clarify I have a database A and two servers B and C. Both B and C communicates with A, but A is to complex to start and thus I need to mock it. What I want to test is that B can send propper requests to C.
– munHunger
Nov 9 at 8:57

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53222220%2ftesting-multiple-servers-with-spring-boot-test%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53222220%2ftesting-multiple-servers-with-spring-boot-test%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)