CodeSVby CA Technologies

Refer to Blazemeter Mock Services transactions from code

< Back

From release 2.0.0, CodeSV provides functionality to use transactions defined in Blazemeter Mock Services in code to replace endpoint definitions.

Usage

To select transactions from Blazemeter Mock Services, should be declared TxnRepoStore object. Using useTransaction methods on store object user can specify criteria for filtering transactions.

 

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

 @Rule
 public VirtualServerRule virtualServerRule = new VirtualServerRule();

 private TxnRepoStore store = new TxnRepoStoreBuilder().build(this);

 @Test
 public void codeSVExampleTest() {
 // virtualization based on Transactions from Repository
 store.useTransaction("Example transaction", "Default Service");

 /* rest of the test */
 }
}