Lecture: Driver Connection -- MongoClientLesson test failure

Hello. In the Driver Connection lecture we are told to run the MongoClientLesson test using mvn test -Dtest=MongoClientLesson.

In that class, the only change I assume I personally need to make is plugging in my connection string:
private String uri = "<YOUR SRV STRING from the application.properties file>";

So I do that, but it still fails. This is because the tests are hard-coded for the database mflix when in Chapter 0, we import the Sample Dataset from Atlas which adds the database sample_mflix.

So…am I just supposed to edit the test like the pinned post here says not to? Or what? Do I rename the database?..

For the lesson or for the ticket?


The lesson. I think I figured out by now I don’t have to run the lesson tests, and that they’re just there for reference. So maybe we’re OK.

1 Like

Sure. But I will note down this point and will make sure lesson scripts get updated :slight_smile:

Thanks for sharing it with us.


I had to modify it to sample_mflix to get it to work
database = mongoClient.getDatabase(“sample_mflix”);

It will be better to correct the code and the video

Hi @rany,

Thanks for notifying this and we are working on updating lecture files to reflect the same.


1 Like