18
18
import java .util .Map ;
19
19
import java .util .Map .Entry ;
20
20
import java .util .TreeMap ;
21
+ import java .util .UUID ;
21
22
import java .util .regex .Pattern ;
22
23
23
24
import org .apache .commons .lang3 .StringUtils ;
@@ -67,7 +68,7 @@ static enum HttpType {
67
68
private BaseRequest request ;
68
69
private Variables variables ; // all static and dynamic parameters set by the user
69
70
private String validationStatus ; // if validation is not set then the field can contain value = "NA"
70
- private String transactionId ; // Transaction Id
71
+ private UUID transactionId ; // Transaction Id
71
72
private String stepGroupName ; // Step group name
72
73
73
74
public LogEvent () {
@@ -84,7 +85,7 @@ public Map<String, String> buildMessage() {
84
85
Map <String , String > map = new TreeMap <>();
85
86
appendField (map , LogFields .EventType , eventType .name ());
86
87
appendField (map , LogFields .SourceType , sourceType .name ());
87
- appendField (map , LogFields .TransactionId , transactionId );
88
+ appendField (map , LogFields .TransactionId , getTransactionId (). toString () );
88
89
appendField (map , LogFields .LoggingKey , loggingKey );
89
90
appendField (map , LogFields .TestPlanName , testPlan != null ? testPlan .getTestPlanName () : null );
90
91
appendField (map , LogFields .GroupName , group != null ? group .getName () : null );
@@ -228,11 +229,11 @@ public void setStepGroupName(String stepGroupName) {
228
229
this .stepGroupName = stepGroupName ;
229
230
}
230
231
231
- public String getTransactionId () {
232
- return transactionId ;
232
+ public UUID getTransactionId () {
233
+ return transactionId = ( transactionId == null ) ? UUID . randomUUID () : transactionId ;
233
234
}
234
235
235
- public void setTransactionId (String transactionId ) {
236
+ public void setTransactionId (UUID transactionId ) {
236
237
this .transactionId = transactionId ;
237
238
}
238
239
0 commit comments