Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Upload definitions to BlazeSV

Dmytro Mykhaliev edited this page Aug 13, 2019 · 4 revisions

In-code definitions of virtual endpoints can be directly uploaded to the Blazemeter Mock Services Repository. Once the test with these definitions runs, they are converted from their in-code form into Transaction format and uploaded to the repository. This is another way how developers using CodeSV or Wiremock can share the artifacts they created in code with other team members who can use and augment with Mock Services UI and spin up Mock Services hosting content imported from the code.

CodeSV

@TransactionCloudRepository(
		workspaces = {"Default Workspace"},
		apiKey = "...",
		apiSecret = "...",
		uri = "https://mock.blazemeter.com"
)
public class CodeSVUploadExampleTest {

	@Rule
	public VirtualServerRule virtualServerRule = new VirtualServerRule();

	private TxnRepoStore store = new TxnRepoStoreBuilder()
			.uploadDslToTransactionRepository("Default Workspace", "Default Service").build(this);

	@Test
	public void codesvEUploadExampleTest() {
		forGet("http://blazedemo.com/cities")
			.doReturn(okMessage().withJsonBody("...cities..."));
				
		/* rest of the test */
	}
}

Clone this wiki locally