1.

What are the tools and libraries available for testing microservices?

Answer»

Important Tools and LIBRARIES for testing Spring-based Microservices are - 

  • JUnit 

the standard test runners 

  • TestNG 

the next generation test runner 

  • Hemcrest 

declarative MATCHERS and assertions 

  • Rest-assured 

for writing REST Api DRIVEN end to end tests 

  • Mockito 

for mocking dependencies 

  • Wiremock 

for stubbing thirdparty services 

  • Hoverfly 

Create API simulation for end-to-end tests. 

  • Spring Test and Spring BOOT Test 

for writing Spring Integration Tests - includes MockMVC, TestRestTemplate, Webclient like features. 

  • JSONassert 

An assertion library for JSON. 

  • Pact 

The Pact family of FRAMEWORKS provide support for Consumer Driven Contracts testing. 

  • Selenium 

Selenium automates browsers. Its used for end-to-end automated ui testing. 

  • Gradle 

Gradle helps build, automate and deliver software, fastr. 

  • IntelliJ IDEA 

IDE for Java Development 

  • Using spring-boot-starter-test 
    • We can just add the below dependency in project’s build.gradle 
    • testCompile('org.springframework.boot:spring-boot-starter-test')

This starter will import two spring boot test modules spring-boot-test & spring-boot-test- autoconfigure as well as Junit, AssertJ, Hamcrest, Mockito, JSONassert, Spring Test, Spring Boot Test and a number of other useful libraries.



Discussion

No Comment Found