Search in sources :

Example 1 with TestProceedingJoinPoint

use of com.fernandocejas.frodo.joinpoint.TestProceedingJoinPoint in project frodo by android10.

the class LogObservableTest method shouldNotWeaveAroundMethodReturningOtherTypeThanObservable.

@Test
public void shouldNotWeaveAroundMethodReturningOtherTypeThanObservable() {
    final TestJoinPoint joinPoint = new TestJoinPoint.Builder(this.getClass(), "toString").withReturnType(this.getClass()).build();
    final TestProceedingJoinPoint proceedingJoinPoint = new TestProceedingJoinPoint(joinPoint);
    assertThat(LogObservable.methodAnnotatedWithRxLogObservable(proceedingJoinPoint)).isFalse();
}
Also used : TestProceedingJoinPoint(com.fernandocejas.frodo.joinpoint.TestProceedingJoinPoint) TestJoinPoint(com.fernandocejas.frodo.joinpoint.TestJoinPoint) Test(org.junit.Test)

Example 2 with TestProceedingJoinPoint

use of com.fernandocejas.frodo.joinpoint.TestProceedingJoinPoint in project frodo by android10.

the class LogSubscriberTest method shouldNotWeaveClassOfOtherTypeThanSubscriber.

@Test
public void shouldNotWeaveClassOfOtherTypeThanSubscriber() {
    final TestJoinPoint joinPoint = new TestJoinPoint.Builder(this.getClass()).build();
    final TestProceedingJoinPoint proceedingJoinPoint = new TestProceedingJoinPoint(joinPoint);
    assertThat(LogSubscriber.classAnnotatedWithRxLogSubscriber(proceedingJoinPoint)).isFalse();
}
Also used : TestProceedingJoinPoint(com.fernandocejas.frodo.joinpoint.TestProceedingJoinPoint) TestJoinPoint(com.fernandocejas.frodo.joinpoint.TestJoinPoint) Test(org.junit.Test)

Example 3 with TestProceedingJoinPoint

use of com.fernandocejas.frodo.joinpoint.TestProceedingJoinPoint in project frodo by android10.

the class ObservableRule method apply.

@Override
public Statement apply(Statement statement, Description description) {
    final TestJoinPoint testJoinPoint = new TestJoinPoint.Builder(declaringType).withReturnType(Observable.class).withReturnValue(OBSERVABLE_STREAM_VALUE).build();
    final TestProceedingJoinPoint testProceedingJoinPoint = new TestProceedingJoinPoint(testJoinPoint);
    frodoProceedingJoinPoint = new FrodoProceedingJoinPoint(testProceedingJoinPoint);
    observableInfo = new ObservableInfo(frodoProceedingJoinPoint);
    return statement;
}
Also used : TestProceedingJoinPoint(com.fernandocejas.frodo.joinpoint.TestProceedingJoinPoint) FrodoProceedingJoinPoint(com.fernandocejas.frodo.joinpoint.FrodoProceedingJoinPoint) TestJoinPoint(com.fernandocejas.frodo.joinpoint.TestJoinPoint)

Example 4 with TestProceedingJoinPoint

use of com.fernandocejas.frodo.joinpoint.TestProceedingJoinPoint in project frodo by android10.

the class LogSubscriberTest method shouldWeaveClassOfTypeSubscriber.

@Test
public void shouldWeaveClassOfTypeSubscriber() {
    final TestJoinPoint joinPoint = new TestJoinPoint.Builder(subscriber.getClass()).build();
    final TestProceedingJoinPoint proceedingJoinPoint = new TestProceedingJoinPoint(joinPoint);
    assertThat(LogSubscriber.classAnnotatedWithRxLogSubscriber(proceedingJoinPoint)).isTrue();
}
Also used : TestProceedingJoinPoint(com.fernandocejas.frodo.joinpoint.TestProceedingJoinPoint) TestJoinPoint(com.fernandocejas.frodo.joinpoint.TestJoinPoint) Test(org.junit.Test)

Aggregations

TestJoinPoint (com.fernandocejas.frodo.joinpoint.TestJoinPoint)4 TestProceedingJoinPoint (com.fernandocejas.frodo.joinpoint.TestProceedingJoinPoint)4 Test (org.junit.Test)3 FrodoProceedingJoinPoint (com.fernandocejas.frodo.joinpoint.FrodoProceedingJoinPoint)1