Develop. Virtualize. Commit.
CodeSV is a free, lightweight, Java library for developers that provides a simple fluent API enabling you to easily define and setup virtual services directly in your unit testing code.
Boost your productivity by simulating services that your code depends on – especially when those services don’t exist or are expensive to use.
Test edge cases and negative scenarios that are hard to reproduce with different services.
CodeSV goes way beyond mocking and empowers you to test the parts of your application that other mocking frameworks fail to reach.
@Rule public VirtualServerRule vs = new VirtualServerRule(); @Test public void testSimpleHttpGetWithResponseCodeAndStringBody() throws IOException { forGet(URL).doReturn( aMessage(CUSTOM_STATUS_CODE) .withStringBody(RESPONSE_BODY_GET) ); HttpGet httpGet = new HttpGet(URL); HttpClient httpClient = HttpClientBuilder.create().build(); HttpResponse httpResponse = httpClient.execute(httpGet); assertEquals(CUSTOM_STATUS_CODE, httpResponse.getStatusLine().getStatusCode()); }
CodeSV at AWS re:Invent 2018
Check out our demo on GitHub here!
Get Started
Save valuable development time and get virtualizing in minutes !
Core Features
File formats, Matching and Complex assertions just to name a few…
Advanced Capabilities
Post-call verification, url parameters, encoding and many more…