Search in sources :

Example 6 with Organization

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

the class MemoryOrganizationRepositoryTest method testSaveOrgWithBadArgs.

@DontRepeat
@Test
public void testSaveOrgWithBadArgs() throws Exception {
    assertThrows(() -> instance.saveOrganization(null)).isInstanceOf(InvalidArgumentException.class);
    assertThrows(() -> instance.saveOrganization(new Organization())).isInstanceOf(InvalidArgumentException.class);
}
Also used : Organization(tech.aroma.thrift.Organization) Test(org.junit.Test)

Example 7 with Organization

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

the class CassandraOrganizationRepositoryIT method testGetOrganization.

@Test
public void testGetOrganization() throws Exception {
    assertThrows(() -> instance.getOrganization(orgId)).isInstanceOf(OrganizationDoesNotExistException.class);
    instance.saveOrganization(org);
    Organization result = instance.getOrganization(orgId);
    assertMostlyMatch(result, org);
}
Also used : Organization(tech.aroma.thrift.Organization) IntegrationTest(tech.sirwellington.alchemy.annotations.testing.IntegrationTest)

Example 8 with Organization

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

the class CassandraOrganizationRepositoryIT method testSaveOrganizationTwice.

@DontRepeat
@TimeSensitive
@Test
public void testSaveOrganizationTwice() throws Exception {
    instance.saveOrganization(org);
    Thread.sleep(5);
    instance.saveOrganization(org);
    Organization result = instance.getOrganization(orgId);
    assertMostlyMatch(result, org);
}
Also used : Organization(tech.aroma.thrift.Organization) IntegrationTest(tech.sirwellington.alchemy.annotations.testing.IntegrationTest) TimeSensitive(tech.sirwellington.alchemy.annotations.testing.TimeSensitive)

Aggregations

Organization (tech.aroma.thrift.Organization)8 Test (org.junit.Test)5 Collectors.toList (java.util.stream.Collectors.toList)2 Collectors.toSet (java.util.stream.Collectors.toSet)2 Sets (sir.wellington.alchemy.collections.sets.Sets)2 User (tech.aroma.thrift.User)2 InvalidArgumentException (tech.aroma.thrift.exceptions.InvalidArgumentException)2 OrganizationDoesNotExistException (tech.aroma.thrift.exceptions.OrganizationDoesNotExistException)2 IntegrationTest (tech.sirwellington.alchemy.annotations.testing.IntegrationTest)2 java.util (java.util)1 List (java.util.List)1 Set (java.util.Set)1 TException (org.apache.thrift.TException)1 Matchers (org.hamcrest.Matchers)1 Assert.assertThat (org.junit.Assert.assertThat)1 Before (org.junit.Before)1 RunWith (org.junit.runner.RunWith)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1 Lists (sir.wellington.alchemy.collections.lists.Lists)1