CodeSV Blog!by CA Technologies, A Broadcom Company

Export definitions as file

How Can We Help?
< Back

From release 2.0.0, CodeSV provides functionality for exporting endpoint definitions from code into json transaction DSL file. This way developers using CodeSV can share the artifacts they created in code with other team members who can use and augment with Mock Services UI in Blazemeter Mock Services and spin up Mock Services hosting content imported from the code.


There are three available options for export.

Export to out directory

Using method exportDslAsFile() would export definitions to out/stubs directory in project root.

public class CodeSVExportExampleTest {

 public VirtualServerRule vs = new VirtualServerRule();

 private TxnRepoStore store = new TxnRepoStoreBuilder()

 public void codesvExportExampleTest() {
 /* rest of the test */ 


Export to custom directory

Using method exportDslAsFile(String dir) would export definitions to custom directory in project root.

Export to custom directory using system property

Setting system propety System.setProperty("repository.dsl.export", DIR_NAME) would also export definitions to custom directory in project root.

Supported matchers

CodeSV supports using hamcrest and in-build matchers in request definitions. To make it compatible with BlazeSV, we introduced export only for the next matchers:

  • HttpFluentInterface.isEqualTo()
  • HttpFluentInterface.matchesRegex()
  • CoreMatchers.not(HttpFluentInterface.matchesRegex())
  • HttpFluentInterface.isEqualTo()
  • HttpFluentInterface.isEqualIgnoringCaseTo()
  • XmlLoadingMatcher(HasXPath.hasXPath())
  • XmlEqualsMatcher()
  • JsonLoadingMatcher(JsonPathMatchers.hasJsonPath())
  • JsonEqualsMatcher()
  • absentHeader()/absentQuery()/absentCookie()/absentBodyPayload()
Previous Class Repository
Next Upload definitions to Blazemeter Mock Services
Table of Contents

Comments are currently closed.