@@ -1,11 +1,11 @@
Loading
1 1
package ch.powerunit.extensions.matchers.provideprocessor.helper;
2 2
3 3
import static ch.powerunit.extensions.matchers.common.CommonUtils.addPrefix;
4 -
import static ch.powerunit.extensions.matchers.provideprocessor.dsl.DSLMethod.of;
5 4
import static java.lang.String.format;
6 5
import static java.util.Arrays.asList;
7 6
import static java.util.Arrays.stream;
8 7
import static java.util.Collections.emptyList;
8 +
import static java.util.Optional.of;
9 9
import static java.util.stream.Collectors.joining;
10 10
11 11
import java.util.Collection;
@@ -20,6 +20,7 @@
Loading
20 20
import ch.powerunit.extensions.matchers.provideprocessor.Matchable;
21 21
import ch.powerunit.extensions.matchers.provideprocessor.ProvidesMatchersAnnotatedElementMirror;
22 22
import ch.powerunit.extensions.matchers.provideprocessor.dsl.DSLMethod;
23 +
import ch.powerunit.extensions.matchers.provideprocessor.dsl.lang.DSLMethodArgument;
23 24
import ch.powerunit.extensions.matchers.provideprocessor.fields.AbstractFieldDescription;
24 25
25 26
public final class ProvidesMatchersWithSameValueHelper {
@@ -48,7 +49,7 @@
Loading
48 49
49 50
	private static DSLMethod generateWithSameValueWithParentMatcherIgnoreAndCycle(
50 51
			ProvidesMatchersAnnotatedElementMirror target, boolean hasSuper) {
51 -
		return of(generateHasSameValueDeclaration(target))
52 +
		return generateHasSameValueDeclaration(target)
52 53
				.addOneArgument(target.getFullyQualifiedNameOfClassAnnotatedWithProvideMatcherWithGeneric(), "other")
53 54
				.addOneArgument("java.util.Set<java.lang.Object>", "previous")
54 55
				.addOneArgument(
@@ -60,8 +61,8 @@
Loading
60 61
						target.getSimpleNameOfGeneratedImplementationMatcherWithGenericNoParent(),
61 62
						generateParentMatcher(target, hasSuper), copyFields(target),
62 63
						target.getSimpleNameOfGeneratedInterfaceMatcher()).split("\n")))
63 -
				.withJavadoc(target.generateDefaultJavaDocWithoutDSLStarter(
64 -
						Optional.of(JAVADOC_OTHER_PREVIOUS_IGNORE_POST), "the DSL matcher", false));
64 +
				.withJavadoc(target.generateDefaultJavaDocWithoutDSLStarter(of(JAVADOC_OTHER_PREVIOUS_IGNORE_POST),
65 +
						"the DSL matcher", false));
65 66
	}
66 67
67 68
	private static String generateParentMatcher(ProvidesMatchersAnnotatedElementMirror target, boolean hasSuper) {
@@ -91,33 +92,32 @@
Loading
91 92
92 93
	private static DSLMethod generateWithSameValueWithParentMatcherIgnoreAndPostProcessor(
93 94
			ProvidesMatchersAnnotatedElementMirror target) {
94 -
		return of(generateHasSameValueDeclaration(target))
95 +
		return generateHasSameValueDeclaration(target)
95 96
				.addOneArgument(target.getFullyQualifiedNameOfClassAnnotatedWithProvideMatcherWithGeneric(), "other")
96 97
				.addOneArgument(
97 98
						"java.util.function.BiFunction<org.hamcrest.Matcher<?>,java.lang.Object,org.hamcrest.Matcher<?>>",
98 99
						"postProcessor")
99 100
				.addOneArgument("String...", "ignoredFields")
100 -
				.withImplementation(generateReturnOther(target, "postProcessor,ignoredFields")).withJavadoc(
101 -
						target.generateDefaultJavaDocWithoutDSLStarter(Optional.of(JAVADOC_OTHER_IGNORE_POSTPROCESSOR),
102 -
								"the DSL matcher", false));
101 +
				.withImplementation(generateReturnOther(target, "postProcessor,ignoredFields"))
102 +
				.withJavadoc(target.generateDefaultJavaDocWithoutDSLStarter(of(JAVADOC_OTHER_IGNORE_POSTPROCESSOR),
103 +
						"the DSL matcher", false));
103 104
	}
104 105
105 106
	private static DSLMethod generateWithSameValueWithParentMatcherIgnore(
106 107
			ProvidesMatchersAnnotatedElementMirror target) {
107 -
		return of(generateHasSameValueDeclaration(target))
108 +
		return generateHasSameValueDeclaration(target)
108 109
				.addOneArgument(target.getFullyQualifiedNameOfClassAnnotatedWithProvideMatcherWithGeneric(), "other")
109 110
				.addOneArgument("String...", "ignoredFields")
110 -
				.withImplementation(generateReturnOther(target, "(m,o)->m,ignoredFields"))
111 -
				.withJavadoc(target.generateDefaultJavaDocWithoutDSLStarter(Optional.of(JAVADOC_OTHER_IGNORE),
112 -
						"the DSL matcher", false));
111 +
				.withImplementation(generateReturnOther(target, "(m,o)->m,ignoredFields")).withJavadoc(target
112 +
						.generateDefaultJavaDocWithoutDSLStarter(of(JAVADOC_OTHER_IGNORE), "the DSL matcher", false));
113 113
	}
114 114
115 115
	private static DSLMethod generateWithSameValueWithParentMatcherAndNoIgnore(
116 116
			ProvidesMatchersAnnotatedElementMirror target) {
117 -
		return of(generateHasSameValueDeclaration(target))
117 +
		return generateHasSameValueDeclaration(target)
118 118
				.withOneArgument(target.getFullyQualifiedNameOfClassAnnotatedWithProvideMatcherWithGeneric(), "other")
119 -
				.withImplementation(generateReturnOther(target, "(m,o)->m,new String[]{}")).withJavadoc(target
120 -
						.generateDefaultJavaDocWithoutDSLStarter(Optional.of(JAVADOC_OTHER), "the DSL matcher", false));
119 +
				.withImplementation(generateReturnOther(target, "(m,o)->m,new String[]{}")).withJavadoc(
120 +
						target.generateDefaultJavaDocWithoutDSLStarter(of(JAVADOC_OTHER), "the DSL matcher", false));
121 121
	}
122 122
123 123
	private static String generateReturnOther(ProvidesMatchersAnnotatedElementMirror target, String complement) {
@@ -125,10 +125,11 @@
Loading
125 125
				target.getMethodNameDSLWithSameValue(), complement);
126 126
	}
127 127
128 -
	private static String generateHasSameValueDeclaration(ProvidesMatchersAnnotatedElementMirror target) {
129 -
		return format("%1$s %2$s.%3$s %4$s", target.getFullGeneric(), target.getFullyQualifiedNameOfGeneratedClass(),
130 -
				target.getSimpleNameOfGeneratedInterfaceMatcherWithGenericNoParent(),
131 -
				target.getMethodNameDSLWithSameValue());
128 +
	private static DSLMethodArgument generateHasSameValueDeclaration(ProvidesMatchersAnnotatedElementMirror target) {
129 +
		return DSLMethod.of(
130 +
				format("%1$s %2$s.%3$s %4$s", target.getFullGeneric(), target.getFullyQualifiedNameOfGeneratedClass(),
131 +
						target.getSimpleNameOfGeneratedInterfaceMatcherWithGenericNoParent(),
132 +
						target.getMethodNameDSLWithSameValue()));
132 133
	}
133 134
134 135
	private static boolean isWeakAllowed(ProvidesMatchersAnnotatedElementMirror target) {
Files Coverage
src/main/java/ch/powerunit/extensions/matchers 99.27%
Project Totals (81 files) 99.27%
2295.2
TRAVIS_OS_NAME=linux
openjdk8=
linuxopenjdk8
2296.2
TRAVIS_OS_NAME=linux
openjdk8=
linuxopenjdk8
2295.1
TRAVIS_OS_NAME=linux
oraclejdk9=
linuxoraclejdk9
2296.1
TRAVIS_OS_NAME=linux
oraclejdk9=
linuxoraclejdk9
2296.3
openjdk10=
TRAVIS_OS_NAME=linux
linuxopenjdk10
2295.3
openjdk10=
TRAVIS_OS_NAME=linux
linuxopenjdk10

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading