Report

 package com.mridul.software.automation.spring.context.properties.extent;  
 import lombok.Data;  
 import org.apache.commons.lang3.StringUtils;  
 import org.springframework.boot.context.properties.ConfigurationProperties;  
 import org.springframework.context.annotation.Configuration;  
 import org.springframework.validation.annotation.Validated;  
 import javax.validation.constraints.NotNull;  
 @Configuration  
 @ConfigurationProperties(prefix = "extent.report")  
 @Validated  
 @Data  
 public class Report {  
   @NotNull  
   private String fileName;  
   @NotNull  
   private Screenshot screenshot;  
   @Data  
   public static class Screenshot {  
     @NotNull  
     private String filePath;  
     @NotNull  
     private Test test;  
     @Data  
     public static class Test {  
       @NotNull  
       private Enable enable;  
       //this parameter is set in extent test listener  
       private static final ThreadLocal<String> METHOD_NAME =  
           ThreadLocal.withInitial(() -> StringUtils.EMPTY);  
       public void setMethodName(String name) {  
         METHOD_NAME.set(name);  
       }  
       public String getMethodName() {  
         return METHOD_NAME.get();  
       }  
       @Data  
       public static class Enable {  
         @NotNull  
         private Boolean onFailure;  
         @NotNull  
         private Boolean forAll;  
       }  
     }  
   }  
 }  

Comments

Popular posts from this blog

FileSystemUtils

TakeScreenshotAspect

GemfireConfig