Forum Discussion

danio9004's avatar
danio9004
Occasional Visitor
12 months ago

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

 

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

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:

 

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

 

1 Reply

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    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

     

    And for Prod

     

    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...

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

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