Search in sources :

Example 21 with Message

use of tech.aroma.thrift.Message in project aroma-data-operations by RedRoma.

the class MemoryMessageRepositoryTest method testGetMessage.

@Test
public void testGetMessage() throws Exception {
    instance.saveMessage(message);
    Message result = instance.getMessage(applicationId, messageId);
    assertThat(result, is(message));
}
Also used : Message(tech.aroma.thrift.Message) Test(org.junit.Test)

Example 22 with Message

use of tech.aroma.thrift.Message in project aroma-data-operations by RedRoma.

the class CassandraInboxRepositoryTest method testContainsMessageInInboxWithBadArgs.

@DontRepeat
@Test
public void testContainsMessageInInboxWithBadArgs() throws Exception {
    assertThrows(() -> instance.containsMessageInInbox(badId, message)).isInstanceOf(InvalidArgumentException.class);
    Message messageWithBadId = new Message(message).setMessageId(badId);
    assertThrows(() -> instance.containsMessageInInbox(userId, messageWithBadId)).isInstanceOf(InvalidArgumentException.class);
    Message messageWithBadAppId = new Message(message).setApplicationId(badId);
    assertThrows(() -> instance.containsMessageInInbox(userId, messageWithBadAppId)).isInstanceOf(InvalidArgumentException.class);
}
Also used : Message(tech.aroma.thrift.Message) Test(org.junit.Test) DontRepeat(tech.sirwellington.alchemy.test.junit.runners.DontRepeat)

Aggregations

Message (tech.aroma.thrift.Message)22 Test (org.junit.Test)12 Statement (com.datastax.driver.core.Statement)8 Row (com.datastax.driver.core.Row)7 ResultSet (com.datastax.driver.core.ResultSet)6 RequestAssertions.validMessage (tech.aroma.data.assertions.RequestAssertions.validMessage)5 InvalidArgumentException (tech.aroma.thrift.exceptions.InvalidArgumentException)5 DontRepeat (tech.sirwellington.alchemy.test.junit.runners.DontRepeat)5 TException (org.apache.thrift.TException)3 User (tech.aroma.thrift.User)3 Session (com.datastax.driver.core.Session)2 List (java.util.List)2 Function (java.util.function.Function)2 LengthOfTime (tech.aroma.thrift.LengthOfTime)2 OperationFailedException (tech.aroma.thrift.exceptions.OperationFailedException)2 IntegrationTest (tech.sirwellington.alchemy.annotations.testing.IntegrationTest)2 QueryBuilder (com.datastax.driver.core.querybuilder.QueryBuilder)1 QueryBuilder.desc (com.datastax.driver.core.querybuilder.QueryBuilder.desc)1 QueryBuilder.eq (com.datastax.driver.core.querybuilder.QueryBuilder.eq)1 QueryBuilder.ttl (com.datastax.driver.core.querybuilder.QueryBuilder.ttl)1