Ask a Question

Problem with environment for databases

danio9004
Occasional Visitor

Problem with environment for databases

Hi, I've two environments: PREP and PROD. I have created Functional Test with using database component. I checking json from database with rest request. As below

danio9004_0-1684157146186.png

 

Earlier I had a test on PREP and it was worked. And next I added PROD and configured databases connections as below:

danio9004_1-1684157297182.png

Test connection for PROD_DWH is successful.

So I changed in database component connection on PROD_DWH and running test connection. In result I got:

danio9004_2-1684157435933.png

 

I don't know what I do wrong. Someone have idea?

 

1 REPLY 1
ChrisAdams
Champion Level 2

Hi,

 

If I've understood the issue, you're not far off.

As you mentioned, you have environments: PREP and PROD.  From your screenshots, it looks like you're using the 'Environment' dropdown to switch between them.

The same should be for your databases.  You shouldn't need to have to name them PREP_DWH and PROD_DWH.  I'd suggest DWH.  From the Databases screen above, it looks like what you've done there is create two db connections for each environment.  One called PRED_DWH and PROD_DWH.

 

Once you defined a connection  in the databases screen, you then use Environments to switch the connection details as you switch the endpoints for the test.

 

Take the following example.  Say I have a SALES API.  I have two environments PRE-PROD and PROD.  They both have their own endpoints.

 

E.g. For Pre-Prod

ChrisAdams_0-1684219729726.png

 

And for Prod

ChrisAdams_1-1684219774390.png

 

I'm guessing this much you have set up yourself.


In the Databases screen, I have two different databases per environment.  Once called Customers and one called Sales.  In the databases screen, you're defining the database names (think purpose, not environment), driver and connection details.  This is where I suggest you only have DWH and not PREP_DWH and PROD_DWH.  Create one called DWH and and provide credentials.  At this point it really doesn't matter which environment your providing details for.

 

For example, here's my examples with the two databases (purpose, not environment) I need for my Sales API...

ChrisAdams_2-1684220201258.png

If I then go to the Configure Environments screen, you can see my environments.  The important bit is the JDBC tab (highlighted)

ChrisAdams_4-1684222375126.png

If you click on that, you can then define the connections based on environment...

ChrisAdams_5-1684222504596.png

 

 

cancel
Showing results for 
Search instead for 
Did you mean: