Search in sources :

Example 26 with User

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

the class MemoryUserRepositoryTest method testGetUser.

@Test
public void testGetUser() throws Exception {
    instance.saveUser(user);
    User result = instance.getUser(userId);
    assertThat(result, is(user));
}
Also used : User(tech.aroma.thrift.User) Test(org.junit.Test)

Example 27 with User

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

the class MeasuredUserRepositoryTest method testGetUserByEmail.

@Test
public void testGetUserByEmail() throws Exception {
    when(delegate.getUserByEmail(email)).thenReturn(user);
    User result = instance.getUserByEmail(email);
    assertThat(result, is(user));
    verify(delegate).getUserByEmail(email);
}
Also used : User(tech.aroma.thrift.User) Test(org.junit.Test)

Example 28 with User

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

the class MeasuredUserRepositoryTest method testFindByGithubProfile.

@Test
public void testFindByGithubProfile() throws Exception {
    when(delegate.findByGithubProfile(githubProfile)).thenReturn(user);
    User result = instance.findByGithubProfile(githubProfile);
    assertThat(result, is(user));
    verify(delegate).findByGithubProfile(githubProfile);
}
Also used : User(tech.aroma.thrift.User) Test(org.junit.Test)

Example 29 with User

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

the class MemoryActivityRepositoryTest method testGetAllEventsForWithBadArgs.

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

Example 30 with User

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

the class MemoryActivityRepositoryTest method testDeleteEventWithBadArgs.

@Test
public void testDeleteEventWithBadArgs() throws Exception {
    assertThrows(() -> instance.deleteEvent("", user)).isInstanceOf(InvalidArgumentException.class);
    assertThrows(() -> instance.deleteEvent(eventId, null)).isInstanceOf(InvalidArgumentException.class);
    assertThrows(() -> instance.deleteEvent(eventId, new User())).isInstanceOf(InvalidArgumentException.class);
}
Also used : User(tech.aroma.thrift.User) Test(org.junit.Test)

Aggregations

User (tech.aroma.thrift.User)39 Test (org.junit.Test)25 IntegrationTest (tech.sirwellington.alchemy.annotations.testing.IntegrationTest)8 TException (org.apache.thrift.TException)4 InvalidArgumentException (tech.aroma.thrift.exceptions.InvalidArgumentException)4 Collectors.toList (java.util.stream.Collectors.toList)3 Application (tech.aroma.thrift.Application)3 java.util (java.util)2 Collectors.toSet (java.util.stream.Collectors.toSet)2 Matchers (org.hamcrest.Matchers)2 Assert.assertThat (org.junit.Assert.assertThat)2 Before (org.junit.Before)2 RunWith (org.junit.runner.RunWith)2 Maps (sir.wellington.alchemy.collections.maps.Maps)2 Sets (sir.wellington.alchemy.collections.sets.Sets)2 RequestAssertions.validUser (tech.aroma.data.assertions.RequestAssertions.validUser)2 Message (tech.aroma.thrift.Message)2 Organization (tech.aroma.thrift.Organization)2 Event (tech.aroma.thrift.events.Event)2 AlchemyGenerator.one (tech.sirwellington.alchemy.generator.AlchemyGenerator.one)2