Search in sources :

Example 21 with Policy

use of com.redhat.cloud.policies.app.model.Policy in project policies-ui-backend by RedHatInsights.

the class FullTriggerHandlingTest method testConditionUpdate1.

@Test
void testConditionUpdate1() {
    Policy p = createPolicy();
    FullTrigger ft = new FullTrigger(p);
    p.conditions = "blabla";
    ft.updateFromPolicy(p);
    assertEquals(1, ft.conditions.size());
    assertEquals("blabla", ft.conditions.get(0).expression);
}
Also used : Policy(com.redhat.cloud.policies.app.model.Policy) FullTrigger(com.redhat.cloud.policies.app.model.engine.FullTrigger) Test(org.junit.jupiter.api.Test)

Aggregations

Policy (com.redhat.cloud.policies.app.model.Policy)21 Msg (com.redhat.cloud.policies.app.model.Msg)11 FullTrigger (com.redhat.cloud.policies.app.model.engine.FullTrigger)11 Path (javax.ws.rs.Path)11 Operation (org.eclipse.microprofile.openapi.annotations.Operation)9 APIResponse (org.eclipse.microprofile.openapi.annotations.responses.APIResponse)9 NotFoundException (javax.ws.rs.NotFoundException)8 Test (org.junit.jupiter.api.Test)8 Transactional (javax.transaction.Transactional)7 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)6 ConnectException (java.net.ConnectException)6 PersistenceException (javax.persistence.PersistenceException)6 SystemException (javax.transaction.SystemException)6 ProcessingException (javax.ws.rs.ProcessingException)6 WebApplicationException (javax.ws.rs.WebApplicationException)6 ConstraintViolationException (org.hibernate.exception.ConstraintViolationException)6 POST (javax.ws.rs.POST)5 ResponseBuilder (javax.ws.rs.core.Response.ResponseBuilder)5 Parameter (org.eclipse.microprofile.openapi.annotations.parameters.Parameter)5 GET (javax.ws.rs.GET)4