Skip to content

Commit

Permalink
Improve InstanceOfAssertFactories Javadoc and test names
Browse files Browse the repository at this point in the history
  • Loading branch information
scordio committed Jan 6, 2024
1 parent 5a47929 commit 2b2e5c9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import java.util.concurrent.atomic.AtomicStampedReference;
import java.util.concurrent.atomic.LongAdder;
import java.util.function.DoublePredicate;
import java.util.function.Function;
import java.util.function.IntPredicate;
import java.util.function.LongPredicate;
import java.util.function.Predicate;
Expand All @@ -65,10 +66,18 @@
import java.util.stream.Stream;

/**
* Static {@link InstanceOfAssertFactory InstanceOfAssertFactories} for {@link Assert#asInstanceOf(InstanceOfAssertFactory)}.
* {@link InstanceOfAssertFactory} instances for Java types.
*
* @author Stefano Cordio
* @since 3.13.0
* @see Assert#asInstanceOf(InstanceOfAssertFactory)
* @see AbstractObjectAssert#extracting(String, InstanceOfAssertFactory)
* @see AbstractObjectAssert#extracting(Function, InstanceOfAssertFactory)
* @see AbstractMapAssert#extractingByKey(Object, InstanceOfAssertFactory)
* @see AbstractOptionalAssert#get(InstanceOfAssertFactory)
* @see AbstractIterableAssert#first(InstanceOfAssertFactory)
* @see AbstractIterableAssert#last(InstanceOfAssertFactory)
* @see AbstractIterableAssert#element(int, InstanceOfAssertFactory)
*/
public interface InstanceOfAssertFactories {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void predicate_factory_should_allow_predicate_assertions() {
}

@Test
void typed_predicate_factory_should_allow_typed_predicate_assertions() {
void predicate_typed_factory_should_allow_predicate_typed_assertions() {
// GIVEN
Object value = (Predicate<String>) Strings::isNullOrEmpty;
// WHEN
Expand Down Expand Up @@ -242,7 +242,7 @@ void completable_future_factory_should_allow_completable_future_assertions() {
}

@Test
void typed_completable_future_factory_should_allow_typed_completable_future_assertions() {
void completable_future_typed_factory_should_allow_completable_future_typed_assertions() {
// GIVEN
Object value = completedFuture("done");
// WHEN
Expand All @@ -262,7 +262,7 @@ void completion_stage_factory_should_allow_completable_future_assertions() {
}

@Test
void typed_completion_stage_factory_should_allow_typed_completable_future_assertions() {
void completion_stage_typed_factory_should_allow_completable_future_typed_assertions() {
// GIVEN
Object value = completedFuture("done");
// WHEN
Expand All @@ -282,7 +282,7 @@ void optional_factory_should_allow_optional_assertions() {
}

@Test
void typed_optional_factory_should_allow_typed_optional_assertions() {
void optional_typed_factory_should_allow_optional_typed_assertions() {
// GIVEN
Object value = Optional.of("something");
// WHEN
Expand Down Expand Up @@ -512,7 +512,7 @@ void future_factory_should_allow_future_assertions() {
}

@Test
void typed_future_factory_should_allow_typed_future_assertions() {
void future_typed_factory_should_allow_future_typed_assertions() {
// GIVEN
Object value = mock(Future.class);
// WHEN
Expand Down Expand Up @@ -622,7 +622,7 @@ void long_2d_array_factory_should_allow_long_2d_array_assertions() {
}

@Test
void type_factory_should_allow_typed_object_assertions() {
void type_factory_should_allow_object_typed_assertions() {
// GIVEN
Object value = "string";
// WHEN
Expand Down Expand Up @@ -652,7 +652,7 @@ void array_2d_factory_should_allow_2d_array_assertions() {
}

@Test
void typed_array_factory_should_allow_typed_array_assertions() {
void array_typed_factory_should_allow_array_typed_assertions() {
// GIVEN
Object value = new Integer[] { 0, 1 };
// WHEN
Expand Down Expand Up @@ -832,7 +832,7 @@ void atomic_integer_field_updater_factory_should_allow_atomic_integer_field_upda
}

@Test
void typed_atomic_integer_field_updater_factory_should_allow_typed_atomic_integer_field_updater_assertions() {
void atomic_integer_field_updater_typed_factory_should_allow_atomic_integer_field_updater_typed_assertions() {
// GIVEN
Object value = AtomicIntegerFieldUpdater.newUpdater(VolatileFieldContainer.class, "intField");
// WHEN
Expand Down Expand Up @@ -882,7 +882,7 @@ void atomic_long_field_updater_factory_should_allow_atomic_long_field_updater_as
}

@Test
void typed_atomic_long_field_updater_factory_should_allow_typed_atomic_long_field_updater_assertions() {
void atomic_long_field_updater_typed_factory_should_allow_atomic_long_field_updater_typed_assertions() {
// GIVEN
Object value = AtomicLongFieldUpdater.newUpdater(VolatileFieldContainer.class, "longField");
// WHEN
Expand All @@ -902,7 +902,7 @@ void atomic_reference_factory_should_allow_atomic_reference_assertions() {
}

@Test
void typed_atomic_reference_factory_should_allow_typed_atomic_reference_assertions() {
void atomic_reference_typed_factory_should_allow_atomic_reference_typed_assertions() {
// GIVEN
Object value = new AtomicReference<>(0);
// WHEN
Expand All @@ -922,7 +922,7 @@ void atomic_reference_array_factory_should_allow_atomic_reference_array_assertio
}

@Test
void typed_atomic_reference_array_factory_should_allow_typed_atomic_reference_array_assertions() {
void atomic_reference_array_typed_factory_should_allow_atomic_reference_array_typed_assertions() {
// GIVEN
Object value = new AtomicReferenceArray<>(new Integer[] { 0, 1 });
// WHEN
Expand All @@ -942,7 +942,7 @@ void atomic_reference_field_updater_factory_should_allow_atomic_reference_field_
}

@Test
void typed_atomic_reference_field_updater_factory_should_allow_typed_atomic_reference_field_updater_assertions() {
void atomic_reference_field_updater_typed_factory_should_allow_atomic_reference_field_updater_typed_assertions() {
// GIVEN
Object value = AtomicReferenceFieldUpdater.newUpdater(VolatileFieldContainer.class, String.class, "stringField");
// WHEN
Expand All @@ -963,7 +963,7 @@ void atomic_markable_reference_factory_should_allow_atomic_markable_reference_as
}

@Test
void typed_atomic_markable_reference_factory_should_allow_typed_atomic_markable_reference_assertions() {
void atomic_markable_reference_typed_factory_should_allow_atomic_markable_reference_typed_assertions() {
// GIVEN
Object value = new AtomicMarkableReference<>(0, false);
// WHEN
Expand All @@ -983,7 +983,7 @@ void atomic_stamped_reference_factory_should_allow_atomic_stamped_reference_asse
}

@Test
void typed_atomic_stamped_reference_factory_should_allow_typed_atomic_stamped_reference_assertions() {
void atomic_stamped_reference_typed_factory_should_allow_atomic_stamped_reference_typed_assertions() {
// GIVEN
Object value = new AtomicStampedReference<>(0, 0);
// WHEN
Expand All @@ -1003,7 +1003,7 @@ void throwable_factory_should_allow_throwable_assertions() {
}

@Test
void typed_throwable_factory_should_allow_typed_throwable_assertions() {
void throwable_typed_factory_should_allow_throwable_typed_assertions() {
// GIVEN
Object value = new RuntimeException("message");
// WHEN
Expand Down Expand Up @@ -1063,7 +1063,7 @@ void iterable_factory_should_allow_iterable_assertions() {
}

@Test
void typed_iterable_factory_should_allow_typed_iterable_assertions() {
void iterable_typed_factory_should_allow_iterable_typed_assertions() {
// GIVEN
Object value = list("Homer", "Marge", "Bart", "Lisa", "Maggie");
// WHEN
Expand All @@ -1083,7 +1083,7 @@ void iterator_factory_should_allow_iterator_assertions() {
}

@Test
void typed_iterator_factory_should_allow_typed_iterator_assertions() {
void iterator_typed_factory_should_allow_iterator_typed_assertions() {
// GIVEN
Object value = list("Homer", "Marge", "Bart", "Lisa", "Maggie").iterator();
// WHEN
Expand All @@ -1103,7 +1103,7 @@ void collection_factory_should_allow_collection_assertions() {
}

@Test
void typed_collection_factory_should_allow_typed_collection_assertions() {
void collection_typed_factory_should_allow_collection_typed_assertions() {
// GIVEN
Object value = list("Homer", "Marge", "Bart", "Lisa", "Maggie");
// WHEN
Expand All @@ -1123,7 +1123,7 @@ void list_factory_should_allow_list_assertions() {
}

@Test
void typed_list_factory_should_allow_typed_list_assertions() {
void list_typed_factory_should_allow_typed_list_assertions() {
// GIVEN
Object value = list("Homer", "Marge", "Bart", "Lisa", "Maggie");
// WHEN
Expand All @@ -1143,7 +1143,7 @@ void stream_factory_should_allow_list_assertions() {
}

@Test
void typed_stream_factory_should_allow_typed_list_assertions() {
void stream_typed_factory_should_allow_typed_list_typed_assertions() {
// GIVEN
Object value = Stream.of(1, 2, 3);
// WHEN
Expand Down Expand Up @@ -1213,7 +1213,7 @@ void map_factory_should_allow_map_assertions() {
}

@Test
void typed_map_factory_should_allow_typed_map_assertions() {
void map_typed_factory_should_allow_map_typed_assertions() {
// GIVEN
Object value = mapOf(entry("key", "value"));
// WHEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/
package org.assertj.guava.api;

import org.assertj.core.api.Assert;
import org.assertj.core.api.InstanceOfAssertFactory;

import com.google.common.base.Optional;
Expand All @@ -25,10 +24,11 @@
import com.google.common.io.ByteSource;

/**
* Guava {@link InstanceOfAssertFactory InstanceOfAssertFactories} for {@link Assert#asInstanceOf(InstanceOfAssertFactory)}.
* {@link InstanceOfAssertFactory} instances for Guava types.
*
* @author Stefano Cordio
* @since 3.3.0
* @see org.assertj.core.api.InstanceOfAssertFactories
*/
public interface InstanceOfAssertFactories {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void multimap_factory_should_allow_multimap_assertions() {
}

@Test
void typed_multimap_factory_should_allow_typed_multimap_assertions() {
void multimap_typed_factory_should_allow_multimap_typed_assertions() {
// GIVEN
Object value = ImmutableMultimap.of("key", "value");
// WHEN
Expand All @@ -87,7 +87,7 @@ void optional_factory_should_allow_optional_assertions() {
}

@Test
void typed_optional_factory_should_allow_typed_optional_assertions() {
void optional_typed_factory_should_allow_optional_typed_assertions() {
// GIVEN
Object value = Optional.of("something");
// WHEN
Expand Down Expand Up @@ -137,7 +137,7 @@ void table_factory_should_allow_table_assertions() {
}

@Test
void typed_table_factory_should_allow_typed_table_assertions() {
void table_typed_factory_should_allow_table_typed_assertions() {
// GIVEN
Object value = ImmutableTable.of(0, 0.0, "value");
// WHEN
Expand All @@ -158,7 +158,7 @@ void multiset_factory_should_allow_multiset_assertions() {
}

@Test
void typed_multiset_factory_should_allow_typed_multiset_assertions() {
void multiset_typed_factory_should_allow_multiset_typed_assertions() {
// GIVEN
Object value = ImmutableMultiset.of("value");
// WHEN
Expand Down

0 comments on commit 2b2e5c9

Please sign in to comment.