Java Code Examples for org.assertj.core.util.CheckReturnValue

The following examples show how to use org.assertj.core.util.CheckReturnValue. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: presto   Source File: PrestoExceptionAssert.java    License: Apache License 2.0 5 votes vote down vote up
@CheckReturnValue
public static PrestoExceptionAssert assertPrestoExceptionThrownBy(ThrowingCallable throwingCallable)
{
    Throwable throwable = catchThrowable(throwingCallable);
    if (throwable == null) {
        failBecauseExceptionWasNotThrown(PrestoException.class);
    }
    assertThat(throwable).isInstanceOf(PrestoException.class);
    return new PrestoExceptionAssert((PrestoException) throwable);
}
 
Example 2
Source Project: json2java4idea   Source File: IdeaProjectTest.java    License: Apache License 2.0 5 votes vote down vote up
@Nonnull
@CheckReturnValue
protected Application getApplication() {
    if (fixture == null) {
        throw new AssertionError("getApplication() must call after setUp()");
    }
    return ApplicationManager.getApplication();
}
 
Example 3
Source Project: json2java4idea   Source File: IdeaProjectTest.java    License: Apache License 2.0 5 votes vote down vote up
@Nonnull
@CheckReturnValue
protected Project getProject() {
    if (fixture == null) {
        throw new AssertionError("getProject() must call after setUp()");
    }
    return fixture.getProject();
}
 
Example 4
Source Project: xmlunit   Source File: ValueAssert.java    License: Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
@CheckReturnValue
// deal with binary incompatible change in AssertJ 3.15.0, see https://github.com/xmlunit/xmlunit/issues/181
public ValueAssert describedAs(final String description, final Object... args) {
    getWritableAssertionInfo().description(description, args);
    return myself;
}
 
Example 5
Source Project: litho   Source File: ComponentAssert.java    License: Apache License 2.0 4 votes vote down vote up
/** Extract the sub components from the underlying Component, returning a ListAssert over it. */
@CheckReturnValue
public ListAssert<InspectableComponent> extractingSubComponents(ComponentContext c) {
  return extracting(SubComponentExtractor.subComponents(c));
}
 
Example 6
Source Project: litho   Source File: ComponentAssert.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Extract the sub components recursively from the underlying Component, returning a ListAssert
 * over it.
 */
@CheckReturnValue
public ListAssert<InspectableComponent> extractingSubComponentsDeeply(ComponentContext c) {
  return extracting(SubComponentDeepExtractor.subComponentsDeeply(c));
}
 
Example 7
Source Project: json2java4idea   Source File: SettingsPanelTest.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull
@CheckReturnValue
private JPanelFixture findPreviewPanel() {
    return window.panel("preview");
}
 
Example 8
Source Project: json2java4idea   Source File: SettingsPanelTest.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull
@CheckReturnValue
private JRadioButtonFixture findRadioButtonByName(@Nonnull @PropertyKey(resourceBundle = "messages.Json2Java4IdeaBundle") String key) {
    return window.radioButton(bundle.message(key));
}
 
Example 9
Source Project: json2java4idea   Source File: SettingsPanelTest.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull
@CheckReturnValue
private JTextComponentFixture findTextFieldByName(@Nonnull @PropertyKey(resourceBundle = "messages.Json2Java4IdeaBundle") String key) {
    return window.textBox(bundle.message(key));
}
 
Example 10
Source Project: litho   Source File: ComponentAssert.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Extract values from the underlying component based on the {@link Extractor} provided.
 *
 * @param extractor The extractor applied to the Component.
 * @param <A> Type of the value extracted.
 * @return ListAssert for the extracted values.
 */
@CheckReturnValue
public <A> ListAssert<A> extracting(Extractor<Component, List<A>> extractor) {
  final List<A> value = extractor.extract(actual);
  return new ListAssert<>(value);
}