Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asStatement method use a non visible API #47

Open
boretti opened this issue Jul 27, 2015 · 0 comments
Open

asStatement method use a non visible API #47

boretti opened this issue Jul 27, 2015 · 0 comments
Labels

Comments

@boretti
Copy link
Member

boretti commented Jul 27, 2015

The asStatement method exposes an API which is not public and so can't be used outside of the framework itself.

It is not necessary an issue as this method is already an alternative way to not use Statement directly.

Here are the workaround :

Not legal

@Test
public void testMe() {
    assertWhen(asStatement(() -> {
    })).throwException(any(Throwable.class));
}

Legal

@Test
    public void testMe() {
        assertWhen((p) -> {
        }).throwException(any(Throwable.class));
    }

Not legal

@Test
public void testMe() {
    assertWhen(asStatement(Demo2::underTest)).throwException(any(Throwable.class));
}

public static void underTest() {
}

Legal

@Test
public void testMe() {
    assertWhen((p) -> {
        Demo2.underTest();
    }).throwException(any(Throwable.class));
}

public static void underTest() {
}

The various method related to function, etc are working and so the impact of this issue is limited.

@boretti boretti added the bug label Jul 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant