package es.sandbox.spikes.java8.interfaces;

import es.sandbox.spikes.java8.InvocationSpy;
import org.junit.Before;
import org.junit.Test;

import static es.sandbox.spikes.java8.FunctionalInterfaceCaller.call;
import static es.sandbox.spikes.java8.InvocationSpy.spy;
import static org.assertj.core.api.Assertions.assertThat;

/**
 * Created by jeslopalo on 30/12/15.
 */
public class FunctionalInterfaceSpecs {

    private InvocationSpy spy;

    @Before
    public void setup() {
        this.spy = spy();
    }

    @Test
    public void has_one_callable_method() {
        call(() -> this.spy.invocation());

        assertThat(this.spy.invoked()).isTrue();
    }
}

@@ -133,16 +133,50 @@
 .Test;%0A%0A
+import java.lang.reflect.Method;%0A%0A
 import s
@@ -578,18 +578,251 @@
 s_on
-e_callable
+ly_one_declared_method() %7B%0A        final Method%5B%5D methods = SimpleFunctionalInterface.class.getDeclaredMethods();%0A%0A        assertThat(methods).hasSize(1);%0A    %7D%0A%0A    @Test%0A    public void when_is_used_in_a_lambda_it_invokes_the_unique_declared
 _met

Test that Functional Interfaces has only one declared method