Skip to content

Instantly share code, notes, and snippets.

@wfouche
Last active February 10, 2026 07:46
Show Gist options
  • Select an option

  • Save wfouche/54d6076f5417b537fcb83ff11d1a64a9 to your computer and use it in GitHub Desktop.

Select an option

Save wfouche/54d6076f5417b537fcb83ff11d1a64a9 to your computer and use it in GitHub Desktop.
Tulip User
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.github.wfouche.tulip.user.HttpUser;
public class APIUser extends HttpUser {
// Action 1: GET /posts
public boolean action1() {
var response = httpGet("/posts");
return response.isSuccessful();
}
// Action 2: POST /posts
public boolean action2() {
String payload = """
{
"title": "Tulip Test Post",
"body": "This is a test post created during load testing",
"userId": 1
}
""";
var response = httpPost(payload, "/posts");
return response.isSuccessful();
}
// Action 3: GET /posts/{id}
public boolean action3() {
int post_id = 1;
var response = httpGet("/posts/{id}", post_id);
return response.isSuccessful();
}
public Logger logger() {
return logger;
}
// Logger
private static final Logger logger = LoggerFactory.getLogger(APIUser.class);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment