Browse Source

Suppress LinguisticNaming pmd check in custom asserts

java-11
parent
commit
54a4c0e4b3
3 changed files with 19 additions and 19 deletions
  1. +7
    -7
      src/test/java/org/perfectable/introspection/bean/BeanAssert.java
  2. +8
    -8
      src/test/java/org/perfectable/introspection/bean/BoundPropertyAssert.java
  3. +4
    -4
      src/test/java/org/perfectable/introspection/query/AbstractQueryAssert.java

+ 7
- 7
src/test/java/org/perfectable/introspection/bean/BeanAssert.java View File

@@ -30,13 +30,13 @@ final class BeanAssert<ELEMENT>
return new BeanAssert<>(actual);
}

public BeanAssert<ELEMENT> hasEmptyFieldProperties() {
public BeanAssert<ELEMENT> hasEmptyFieldProperties() { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
iterables.assertEmpty(info, actual.fieldProperties());
return this;
}

public BeanAssert<ELEMENT> hasFieldPropertiesWithNames(String... names) {
public BeanAssert<ELEMENT> hasFieldPropertiesWithNames(String... names) { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
List<String> fieldPropertiesNames =
actual.fieldProperties().stream().map(BoundProperty::name).collect(toList());
@@ -44,19 +44,19 @@ final class BeanAssert<ELEMENT>
return this;
}

public BeanAssert<ELEMENT> hasTypeExactly(Class<?> expectedType) {
public BeanAssert<ELEMENT> hasTypeExactly(Class<?> expectedType) { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertEqual(info, actual.type(), expectedType);
return this;
}

public BeanAssert<ELEMENT> hasEmptyRelated() {
public BeanAssert<ELEMENT> hasEmptyRelated() { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
iterables.assertEmpty(info, actual.related());
return this;
}

public BeanAssert<ELEMENT> hasRelated(Object... expectedRelated) {
public BeanAssert<ELEMENT> hasRelated(Object... expectedRelated) { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
iterables.assertContains(info, actual.related(), expectedRelated);
return this;
@@ -79,13 +79,13 @@ final class BeanAssert<ELEMENT>
return propertyAssert;
}

public BeanAssert<ELEMENT> hasContentsSameAs(ELEMENT expectedContents) {
public BeanAssert<ELEMENT> hasContentsSameAs(ELEMENT expectedContents) { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertSame(info, actual.contents(), expectedContents);
return this;
}

public BeanAssert<ELEMENT> hasConsistentCopyMechanism() {
public BeanAssert<ELEMENT> hasConsistentCopyMechanism() { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
Bean<ELEMENT> copy = actual.copy();
objects.assertNotEqual(info, copy, actual);


+ 8
- 8
src/test/java/org/perfectable/introspection/bean/BoundPropertyAssert.java View File

@@ -16,49 +16,49 @@ final class BoundPropertyAssert<VALUE>
return new BoundPropertyAssert<>(actual);
}

public BoundPropertyAssert<VALUE> hasName(String expectedName) {
public BoundPropertyAssert<VALUE> hasName(String expectedName) { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertEqual(info, actual.name(), expectedName);
return this;
}

public BoundPropertyAssert<VALUE> hasTypeExactly(Class<?> expectedType) {
public BoundPropertyAssert<VALUE> hasTypeExactly(Class<?> expectedType) { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertEqual(info, actual.type(), expectedType);
return this;
}

public BoundPropertyAssert<VALUE> isWritable() {
public BoundPropertyAssert<VALUE> isWritable() { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertEqual(info, actual.isWritable(), true);
return this;
}

public BoundPropertyAssert<VALUE> isNotWritable() {
public BoundPropertyAssert<VALUE> isNotWritable() { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertEqual(info, actual.isWritable(), false);
return this;
}

public BoundPropertyAssert<VALUE> isReadable() {
public BoundPropertyAssert<VALUE> isReadable() { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertEqual(info, actual.isReadable(), true);
return this;
}

public BoundPropertyAssert<VALUE> isNotReadable() {
public BoundPropertyAssert<VALUE> isNotReadable() { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertEqual(info, actual.isReadable(), false);
return this;
}

public BoundPropertyAssert<VALUE> hasNullValue() {
public BoundPropertyAssert<VALUE> hasNullValue() { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertNull(info, actual.get());
return this;
}

public BoundPropertyAssert<VALUE> hasValueSameAs(VALUE expectedValue) {
public BoundPropertyAssert<VALUE> hasValueSameAs(VALUE expectedValue) { // SUPPRESS LinguisticNaming
objects.assertNotNull(info, actual);
objects.assertSame(info, actual.get(), expectedValue);
return this;


+ 4
- 4
src/test/java/org/perfectable/introspection/query/AbstractQueryAssert.java View File

@@ -31,7 +31,7 @@ final class AbstractQueryAssert<ELEMENT, MAPPED>
return new AbstractQueryAssert<>(actual, Function.identity(), element -> true);
}

AbstractQueryAssert<ELEMENT, MAPPED> isEmpty() {
AbstractQueryAssert<ELEMENT, MAPPED> isEmpty() { // SUPPRESS LinguisticNaming
isNotNull();
iterables.assertEmpty(info, actual);
if (actual.isPresent()) {
@@ -46,7 +46,7 @@ final class AbstractQueryAssert<ELEMENT, MAPPED>
return myself;
}

AbstractQueryAssert<ELEMENT, MAPPED> isSingleton(MAPPED onlyElement) {
AbstractQueryAssert<ELEMENT, MAPPED> isSingleton(MAPPED onlyElement) { // SUPPRESS LinguisticNaming
isNotNull();
containsExactly(onlyElement);
hasOption(onlyElement);
@@ -54,7 +54,7 @@ final class AbstractQueryAssert<ELEMENT, MAPPED>
return myself;
}

AbstractQueryAssert<ELEMENT, MAPPED> hasOption(MAPPED onlyElement) {
AbstractQueryAssert<ELEMENT, MAPPED> hasOption(MAPPED onlyElement) { // SUPPRESS LinguisticNaming
checkOptionPresent();
Optional<? extends ELEMENT> option = actual.option();
MAPPED optionValue = option.map(mapper).get();
@@ -64,7 +64,7 @@ final class AbstractQueryAssert<ELEMENT, MAPPED>
return myself;
}

AbstractQueryAssert<ELEMENT, MAPPED> hasUnique(MAPPED onlyElement) {
AbstractQueryAssert<ELEMENT, MAPPED> hasUnique(MAPPED onlyElement) { // SUPPRESS LinguisticNaming
isNotNull();
try {
ELEMENT uniqueResult = this.actual.unique();


Loading…
Cancel
Save