use of org.wso2.carbon.apimgt.rest.api.admin.dto.ThreatProtectionPolicyDTO in project carbon-apimgt by wso2.
the class SampleTestObjectCreator method createUniqueThreatProtectionPolicyDTO.
/**
* Creates a new {@link ThreatProtectionPolicyDTO} object for testing purposes
* @return {@link ThreatProtectionPolicyDTO}
*/
public static ThreatProtectionPolicyDTO createUniqueThreatProtectionPolicyDTO() {
ThreatProtectionPolicyDTO dto = new ThreatProtectionPolicyDTO();
dto.setUuid(UUID.randomUUID().toString());
dto.setType("JSON");
dto.setName("JSON POLICY 1");
String policyString = "{\"maxFieldLength\": 20, \"maxDepth\": 20, \"maxFieldCount\": 20, " + "\"maxStringLength\": 100, \"maxArrayElementCount\": 100}";
dto.setPolicy(policyString);
return dto;
}
use of org.wso2.carbon.apimgt.rest.api.admin.dto.ThreatProtectionPolicyDTO in project carbon-apimgt by wso2.
the class MappingUtil method toThreatProtectionPolicyDTO.
public static ThreatProtectionPolicyDTO toThreatProtectionPolicyDTO(ThreatProtectionPolicy policy) {
ThreatProtectionPolicyDTO dto = new ThreatProtectionPolicyDTO();
dto.setUuid(policy.getUuid());
dto.setType(policy.getType());
dto.setName(policy.getName());
dto.setPolicy(policy.getPolicy());
return dto;
}
Aggregations