External system stub "Subuta" (Introduction)

Introduction

When developing a system, you can make requests to external systems via HTTP, or create functions for exchanging files via FTP. In the unit test, stubs are used instead of such an external system, but it is good if it returns a fixed response, but there is a request to change the stub response for each request data. .. There is an opinion that such a thing should be tested by external connection, but there are cases where test data cannot be created in the opposite system and application is troublesome. It's a core system.

Tried to make it

That's why I made a stub that can freely change the response data for each request data. Its name is also "Subuta". https://sites.google.com/site/subutapj/

It's not open source and I haven't given it to Git, but Ichiou source can be downloaded, so it seems like source open software.

What you can do

・ REST ・ FTP server ・ SMTP server It has a function. FTP and SMTP are simply servers. I implemented it because it is troublesome to install an FTP server etc. every time to test FTP and SMTP. However, it has no more functions than a server. The main function of Subuta is REST, and as mentioned above, it is possible to change the response for each request.

Installation

Subuta is a Java web application, so it is distributed by WAR. Please download from here. https://sites.google.com/site/subutapj/subuta

It works if you have a Tomcat environment. I have placed WAR under% TOMCAT_HOME% / webapps and started Tomcat. http://[IP]:[PORT]/subuta Try to access. You should see a screen like ↓.

Yes. This completes the preparation.

Dependencies ・ Java 7 or later ・ Tomcat 6 migration I haven't confirmed the operation of earlier versions, so it may work other than this. DB uses SQLite.

Other

SQLite files and files generated by Subuta are output under% TOMCAT_HOME%. Subuta is updated occasionally, but basically it is backward compatible and can be upgraded simply by replacing WAR.

Next time, I will explain how to make an API.

Recommended Posts

External system stub "Subuta" (Introduction)
Introduction to RSpec 6. System specifications
Introduction to Ruby processing system self-made