spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

Consider Testcontainers (Localstack) to replace Mockito for AWS integrations

Open MatejNedic opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe. Not a problem but rather making tests run against real integration.

Describe the solution you'd like Currently, all of AWS Repository tests are being mocked with Mockito, Localstack can be used to provide real integration tests. This would help when new features or integrations are introduced.

Additional context If this is something that is worth doing, I am willing to take this issue.

MatejNedic avatar Aug 02 '22 21:08 MatejNedic

Sound interesting! If you want to take a go at implementing it we can take a look!

ryanjbaxter avatar Aug 03 '22 00:08 ryanjbaxter

The PR #2099 contained three integration tests with Localstack for AWS SSM, S3, and Secrets Manager, respectively. They should work as is. In any case, they could be used as a starting point.

hpoettker avatar Aug 03 '22 19:08 hpoettker

Can you separate out the tests from that PR into a new PR?

ryanjbaxter avatar Aug 03 '22 20:08 ryanjbaxter

Hey @hpoettker, I already have PR mostly done but since you spent time on this in past I think you should finish it.

Just something to note I would recommend moving all unit tests to integration ones completely and refactor all Aws*EnvironmentRepositoryTests to use Localstack.

@ryanjbaxter what are your thoughts about moving unit tests to Integration ones instead?

MatejNedic avatar Aug 03 '22 21:08 MatejNedic

@MatejNedic Thanks for the kind offer. But please feel free to go ahead.

The tests in #2099 had a much more limited scope compared to your suggestion. As a broader scope definitely has its merits, I don't see a good reason to stick with the old PR unless a limited scope is strongly preferred.

hpoettker avatar Aug 03 '22 21:08 hpoettker

@MatejNedic thats fine

ryanjbaxter avatar Aug 03 '22 22:08 ryanjbaxter

Hey, sorry for the delay I was on vacation and some other things took priority. I am currently in process of polishing tests and will have PR soon.

MatejNedic avatar Aug 24 '22 19:08 MatejNedic