Search in sources :

Example 1 with ValuesIn

use of com.redhat.service.bridge.infra.models.filters.ValuesIn in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class FilterEvaluatorFactoryFEELTest method valuesInWithTemplate.

@Test
public void valuesInWithTemplate() {
    String expectedMulti = "if data.name = \"jacopo\" or data.name = \"rota\" or data.name = 2 then \"OK\" else \"NOT_OK\"";
    String templateMulti = TEMPLATE_FACTORY_FEEL.getTemplateByFilterType(new ValuesIn("data.name", Arrays.asList("jacopo", "rota", 2)));
    assertThat(templateMulti).isEqualTo(expectedMulti);
}
Also used : ValuesIn(com.redhat.service.bridge.infra.models.filters.ValuesIn) Test(org.junit.jupiter.api.Test)

Example 2 with ValuesIn

use of com.redhat.service.bridge.infra.models.filters.ValuesIn in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class ProcessorAPITest method addProcessorWithWrongFilterFiltersToBridge.

@Test
@TestSecurity(user = TestConstants.DEFAULT_CUSTOMER_ID)
public void addProcessorWithWrongFilterFiltersToBridge() {
    BridgeResponse bridgeResponse = createAndDeployBridge();
    Response response = TestUtils.addProcessorToBridge(bridgeResponse.getId(), new ProcessorRequest("myProcessor", Collections.singleton(new ValuesIn("pepe", null)), null, createKafkaAction()));
    assertThat(response.getStatusCode()).isEqualTo(400);
}
Also used : ProcessorListResponse(com.redhat.service.bridge.manager.api.models.responses.ProcessorListResponse) BridgeResponse(com.redhat.service.bridge.manager.api.models.responses.BridgeResponse) ProcessorResponse(com.redhat.service.bridge.manager.api.models.responses.ProcessorResponse) Response(io.restassured.response.Response) ProcessorRequest(com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest) ValuesIn(com.redhat.service.bridge.infra.models.filters.ValuesIn) BridgeResponse(com.redhat.service.bridge.manager.api.models.responses.BridgeResponse) TestSecurity(io.quarkus.test.security.TestSecurity) QuarkusTest(io.quarkus.test.junit.QuarkusTest) Test(org.junit.jupiter.api.Test)

Aggregations

ValuesIn (com.redhat.service.bridge.infra.models.filters.ValuesIn)2 Test (org.junit.jupiter.api.Test)2 ProcessorRequest (com.redhat.service.bridge.manager.api.models.requests.ProcessorRequest)1 BridgeResponse (com.redhat.service.bridge.manager.api.models.responses.BridgeResponse)1 ProcessorListResponse (com.redhat.service.bridge.manager.api.models.responses.ProcessorListResponse)1 ProcessorResponse (com.redhat.service.bridge.manager.api.models.responses.ProcessorResponse)1 QuarkusTest (io.quarkus.test.junit.QuarkusTest)1 TestSecurity (io.quarkus.test.security.TestSecurity)1 Response (io.restassured.response.Response)1