Search in sources :

Example 11 with User

use of org.infinispan.protostream.sampledomain.User in project camel-spring-boot by apache.

the class InfinispanRemoteQueryProducerIT method producerQueryWithoutResult.

private void producerQueryWithoutResult(String endpoint, final InfinispanQueryBuilder builder) {
    Exchange request = template.request(endpoint, createQueryProcessor(builder));
    assertNull(request.getException());
    List<User> queryResult = request.getIn().getBody(List.class);
    assertNotNull(queryResult);
    assertEquals(0, queryResult.size());
}
Also used : Exchange(org.apache.camel.Exchange) User(org.infinispan.protostream.sampledomain.User)

Example 12 with User

use of org.infinispan.protostream.sampledomain.User in project camel-spring-boot by apache.

the class InfinispanRemoteQueryProducerIT method producerQueryWithResult.

private void producerQueryWithResult(String endpoint, final InfinispanQueryBuilder builder) {
    Exchange request = template.request(endpoint, createQueryProcessor(builder));
    assertNull(request.getException());
    List<User> queryResult = request.getIn().getBody(List.class);
    assertNotNull(queryResult);
    assertEquals(2, queryResult.size());
    assertTrue(hasUser(queryResult, "nameA", "surnameA"));
    assertTrue(hasUser(queryResult, "nameA", "surnameB"));
}
Also used : Exchange(org.apache.camel.Exchange) User(org.infinispan.protostream.sampledomain.User)

Example 13 with User

use of org.infinispan.protostream.sampledomain.User in project camel-spring-boot by apache.

the class InfinispanRemoteQueryTestSupport method createUser.

public static User createUser(String name, String surname) {
    User user = new User();
    user.setName(name);
    user.setSurname(surname);
    return user;
}
Also used : User(org.infinispan.protostream.sampledomain.User)

Example 14 with User

use of org.infinispan.protostream.sampledomain.User in project camel by apache.

the class InfinispanRemoteQueryProducerIT method producerQueryOperationWithoutQueryBuilder.

@Test
public void producerQueryOperationWithoutQueryBuilder() throws Exception {
    Exchange request = template.request("direct:start", new Processor() {

        @Override
        public void process(Exchange exchange) throws Exception {
            exchange.getIn().setHeader(OPERATION, QUERY);
        }
    });
    assertNull(request.getException());
    List<User> queryResult = request.getIn().getHeader(RESULT, List.class);
    assertNull(queryResult);
}
Also used : Exchange(org.apache.camel.Exchange) Processor(org.apache.camel.Processor) User(org.infinispan.protostream.sampledomain.User) UserUtils.hasUser(org.apache.camel.component.infinispan.util.UserUtils.hasUser) IOException(java.io.IOException) Test(org.junit.Test)

Example 15 with User

use of org.infinispan.protostream.sampledomain.User in project camel by apache.

the class InfinispanRemoteQueryProducerIT method producerQueryWithoutResult.

private void producerQueryWithoutResult(String endpoint, final InfinispanQueryBuilder builder) throws Exception {
    Exchange request = template.request(endpoint, createQueryProcessor(builder));
    assertNull(request.getException());
    List<User> queryResult = request.getIn().getHeader(RESULT, List.class);
    assertNotNull(queryResult);
    assertEquals(0, queryResult.size());
}
Also used : Exchange(org.apache.camel.Exchange) User(org.infinispan.protostream.sampledomain.User) UserUtils.hasUser(org.apache.camel.component.infinispan.util.UserUtils.hasUser)

Aggregations

User (org.infinispan.protostream.sampledomain.User)29 Test (org.junit.Test)15 QueryFactory (org.infinispan.query.dsl.QueryFactory)12 Exchange (org.apache.camel.Exchange)5 Address (org.infinispan.protostream.sampledomain.Address)5 UserUtils.hasUser (org.apache.camel.component.infinispan.util.UserUtils.hasUser)4 TestUser (org.infinispan.server.test.api.TestUser)3 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)2 RestCacheClient (org.infinispan.client.rest.RestCacheClient)2 RestClientConfigurationBuilder (org.infinispan.client.rest.configuration.RestClientConfigurationBuilder)2 IOException (java.io.IOException)1 Instant (java.time.Instant)1 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)1 Processor (org.apache.camel.Processor)1 CamelSpringBootTest (org.apache.camel.test.spring.junit5.CamelSpringBootTest)1 RemoteCacheManager (org.infinispan.client.hotrod.RemoteCacheManager)1 ConfigurationBuilder (org.infinispan.client.hotrod.configuration.ConfigurationBuilder)1 RestClient (org.infinispan.client.rest.RestClient)1