Skip to content

Commit 83eec10

Browse files
committed
Reformat code
1 parent da62393 commit 83eec10

File tree

46 files changed

+1110
-1165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1110
-1165
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd ">
44

55
<modelVersion>4.0.0</modelVersion>

src/main/java/org/assertj/vavr/api/AbstractEitherAssert.java

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*/
1515

1616
import io.vavr.control.Either;
17-
1817
import org.assertj.core.api.AbstractAssert;
1918
import org.assertj.core.api.Assertions;
2019
import org.assertj.core.internal.ComparatorBasedComparisonStrategy;
@@ -38,10 +37,9 @@
3837
/**
3938
* Assertions for {@link Either}.
4039
*
41-
* @param <SELF> the "self" type of this assertion class.
42-
* @param <LEFT> type of the left value contained in the {@link Either}.
40+
* @param <SELF> the "self" type of this assertion class.
41+
* @param <LEFT> type of the left value contained in the {@link Either}.
4342
* @param <RIGHT> type of the right value contained in the {@link Either}.
44-
*
4543
* @author Alex Dukhno
4644
* @author Michał Chmielarz
4745
*/
@@ -75,13 +73,13 @@ public SELF isRight() {
7573
return myself;
7674
}
7775

78-
/**
79-
* Verifies that the actual {@link io.vavr.control.Either} is {@link io.vavr.control.Either.Right}
80-
* and contains the given value.
81-
*
82-
* @param expectedValue the expected value inside the {@link io.vavr.control.Either}.
83-
* @return this assertion object.
84-
*/
76+
/**
77+
* Verifies that the actual {@link io.vavr.control.Either} is {@link io.vavr.control.Either.Right}
78+
* and contains the given value.
79+
*
80+
* @param expectedValue the expected value inside the {@link io.vavr.control.Either}.
81+
* @return this assertion object.
82+
*/
8583
public SELF containsOnRight(RIGHT expectedValue) {
8684
assertIsRight();
8785
checkNotNull(expectedValue);
@@ -90,13 +88,13 @@ public SELF containsOnRight(RIGHT expectedValue) {
9088
return myself;
9189
}
9290

93-
/**
94-
* Verifies that the actual {@link io.vavr.control.Either} is {@link io.vavr.control.Either.Left}
95-
* and contains the given value.
96-
*
97-
* @param expectedValue the expected value inside the {@link io.vavr.control.Either}.
98-
* @return this assertion object.
99-
*/
91+
/**
92+
* Verifies that the actual {@link io.vavr.control.Either} is {@link io.vavr.control.Either.Left}
93+
* and contains the given value.
94+
*
95+
* @param expectedValue the expected value inside the {@link io.vavr.control.Either}.
96+
* @return this assertion object.
97+
*/
10098
public SELF containsOnLeft(LEFT expectedValue) {
10199
assertIsLeft();
102100
checkNotNull(expectedValue);
@@ -105,11 +103,10 @@ public SELF containsOnLeft(LEFT expectedValue) {
105103
return myself;
106104
}
107105

108-
/**
106+
/**
109107
* Verifies that the actual {@link io.vavr.control.Either} contains the instance given as an argument as the right value.
110108
*
111109
* @param expectedValue the expected value inside the {@link io.vavr.control.Either}.
112-
*
113110
* @return this assertion object.
114111
*/
115112
public SELF containsRightSame(RIGHT expectedValue) {
@@ -124,7 +121,6 @@ public SELF containsRightSame(RIGHT expectedValue) {
124121
* Verifies that the actual {@link io.vavr.control.Either} contains the instance given as an argument as the left value.
125122
*
126123
* @param expectedValue the expected value inside the {@link io.vavr.control.Either}.
127-
*
128124
* @return this assertion object.
129125
*/
130126
public SELF containsLeftSame(LEFT expectedValue) {
@@ -139,7 +135,6 @@ public SELF containsLeftSame(LEFT expectedValue) {
139135
* Verifies that the actual right-sided {@link io.vavr.control.Either} contains a value that is an instance of the argument.
140136
*
141137
* @param clazz the expected class of the value inside the right-sided {@link io.vavr.control.Either}.
142-
*
143138
* @return this assertion object.
144139
*/
145140
public SELF containsRightInstanceOf(Class<?> clazz) {
@@ -153,7 +148,6 @@ public SELF containsRightInstanceOf(Class<?> clazz) {
153148
* Verifies that the actual left-sided {@link io.vavr.control.Either} contains a value that is an instance of the argument.
154149
*
155150
* @param clazz the expected class of the value inside the left-sided {@link io.vavr.control.Either}.
156-
*
157151
* @return this assertion object.
158152
*/
159153
public SELF containsLeftInstanceOf(Class<?> clazz) {

src/main/java/org/assertj/vavr/api/AbstractTryAssert.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public <U> AbstractTryAssert<?, U> map(Function<? super VALUE, ? extends U> mapp
199199
* @param reason the expected exception class.
200200
* @return this assertion object.
201201
*/
202-
public <U extends Throwable> SELF failBecauseOf(Class<U> reason){
202+
public <U extends Throwable> SELF failBecauseOf(Class<U> reason) {
203203
isNotNull();
204204
checkNotNull(reason);
205205
assertIsFailure();
@@ -213,7 +213,7 @@ public <U extends Throwable> SELF failBecauseOf(Class<U> reason){
213213
* @param exceptionMessage the expected exception message.
214214
* @return this assertion object.
215215
*/
216-
public SELF failReasonHasMessage(String exceptionMessage){
216+
public SELF failReasonHasMessage(String exceptionMessage) {
217217
isNotNull();
218218
checkNotNull(exceptionMessage);
219219
assertIsFailure();

src/main/java/org/assertj/vavr/api/EitherAssert.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
/**
66
* Assertions for {@link io.vavr.control.Either}.
77
*
8-
* @param <LEFT> type of the value on the left contained in the {@link io.vavr.control.Either}.
8+
* @param <LEFT> type of the value on the left contained in the {@link io.vavr.control.Either}.
99
* @param <RIGHT> type of the value on the right contained in the {@link io.vavr.control.Either}.
1010
* @author Alex Dukhno
1111
*/
1212
public class EitherAssert<LEFT, RIGHT> extends AbstractEitherAssert<EitherAssert<LEFT, RIGHT>, LEFT, RIGHT> {
13-
EitherAssert(Either<LEFT, RIGHT> actual) {
14-
super(actual, EitherAssert.class);
15-
}
13+
EitherAssert(Either<LEFT, RIGHT> actual) {
14+
super(actual, EitherAssert.class);
15+
}
1616
}

src/main/java/org/assertj/vavr/api/EitherShouldBeLeft.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.assertj.vavr.api;
22

33
import io.vavr.control.Either;
4-
54
import org.assertj.core.error.BasicErrorMessageFactory;
65

76
/**

src/main/java/org/assertj/vavr/api/EitherShouldBeRight.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.assertj.vavr.api;
22

33
import io.vavr.control.Either;
4-
54
import org.assertj.core.error.BasicErrorMessageFactory;
65

76
/**

src/main/java/org/assertj/vavr/api/EitherShouldContain.java

Lines changed: 43 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*/
1515

1616
import io.vavr.control.Either;
17-
1817
import org.assertj.core.error.BasicErrorMessageFactory;
1918

2019
/**
@@ -30,52 +29,49 @@ class EitherShouldContain extends BasicErrorMessageFactory {
3029
private static final String EXPECTING_TO_CONTAIN_SAME = "%nExpecting:%n <%s>%nto contain the instance (i.e. compared with ==):%n <%s>%nbut did not.";
3130
private static final String EXPECTING_TO_CONTAIN_BUT_IS_LEFT = "%nExpecting:%n <%s>%nto contain on right side:%n <%s>%nbut was left sided.";
3231
private static final String EXPECTING_TO_CONTAIN_BUT_IS_RIGHT = "%nExpecting:%n <%s>%nto contain on right side:%n <%s>%nbut was right sided.";
33-
32+
private static final String EXPECTING_TO_CONTAIN_ON_THE_LEFT = "%nExpecting:%n <%s>%nto contain:%n <%s> on the [LEFT]%nbut did not.";
33+
private static final String EXPECTING_TO_CONTAIN_ON_THE_RIGHT = "%nExpecting:%n <%s>%nto contain:%n <%s> on the [RIGHT]%nbut did not.";
34+
private static final String EXPECTING_ON_THE_LEFT = "%nExpecting:%n <%s>%nto contain on the [LEFT]:%n <%s>%nbut had <%s> on the [RIGHT].";
35+
private static final String EXPECTING_ON_THE_RIGHT = "%nExpecting:%n <%s>%nto contain on the [RIGHT]:%n <%s>%nbut had <%s> on the [LEFT].";
3436
private EitherShouldContain(String message, Object actual, Object expected) {
3537
super(message, actual, expected);
3638
}
3739

38-
private static final String EXPECTING_TO_CONTAIN_ON_THE_LEFT = "%nExpecting:%n <%s>%nto contain:%n <%s> on the [LEFT]%nbut did not.";
39-
private static final String EXPECTING_TO_CONTAIN_ON_THE_RIGHT = "%nExpecting:%n <%s>%nto contain:%n <%s> on the [RIGHT]%nbut did not.";
40-
41-
private static final String EXPECTING_ON_THE_LEFT = "%nExpecting:%n <%s>%nto contain on the [LEFT]:%n <%s>%nbut had <%s> on the [RIGHT].";
42-
private static final String EXPECTING_ON_THE_RIGHT = "%nExpecting:%n <%s>%nto contain on the [RIGHT]:%n <%s>%nbut had <%s> on the [LEFT].";
43-
44-
private EitherShouldContain(String format, Object... arguments) {
45-
super(format, arguments);
46-
}
40+
private EitherShouldContain(String format, Object... arguments) {
41+
super(format, arguments);
42+
}
4743

48-
/**
49-
* Indicates that the provided {@link io.vavr.control.Either} does not contain the provided argument.
50-
*
51-
* @param either the {@link io.vavr.control.Either} which contains a value.
52-
* @param expected the value we expect to be in the provided {@link io.vavr.control.Either}.
53-
* @param <LEFT> the type of the value contained in the {@link io.vavr.control.Either} on the left.
54-
* @param <RIGHT> the type of the value contained in the {@link io.vavr.control.Either} on the right.
55-
* @return an error message factory
56-
*/
57-
static <LEFT, RIGHT> EitherShouldContain shouldContain(Either<LEFT, RIGHT> either,
58-
Object expected) {
59-
return either.isLeft() ?
60-
new EitherShouldContain(EXPECTING_TO_CONTAIN_ON_THE_LEFT, either, expected) :
61-
new EitherShouldContain(EXPECTING_TO_CONTAIN_ON_THE_RIGHT, either, expected);
62-
}
44+
/**
45+
* Indicates that the provided {@link io.vavr.control.Either} does not contain the provided argument.
46+
*
47+
* @param either the {@link io.vavr.control.Either} which contains a value.
48+
* @param expected the value we expect to be in the provided {@link io.vavr.control.Either}.
49+
* @param <LEFT> the type of the value contained in the {@link io.vavr.control.Either} on the left.
50+
* @param <RIGHT> the type of the value contained in the {@link io.vavr.control.Either} on the right.
51+
* @return an error message factory
52+
*/
53+
static <LEFT, RIGHT> EitherShouldContain shouldContain(Either<LEFT, RIGHT> either,
54+
Object expected) {
55+
return either.isLeft() ?
56+
new EitherShouldContain(EXPECTING_TO_CONTAIN_ON_THE_LEFT, either, expected) :
57+
new EitherShouldContain(EXPECTING_TO_CONTAIN_ON_THE_RIGHT, either, expected);
58+
}
6359

64-
/**
65-
* Indicates that the provided {@link io.vavr.control.Either} does not contain the provided argument on expected side.
66-
*
67-
* @param either the {@link io.vavr.control.Either} which contains a value.
68-
* @param expected the value we expect to be in the provided {@link io.vavr.control.Either}.
69-
* @param <LEFT> the type of the value contained in the {@link io.vavr.control.Either} on the left.
70-
* @param <RIGHT> the type of the value contained in the {@link io.vavr.control.Either} on the right.
71-
* @return an error message factory
72-
*/
73-
static <LEFT, RIGHT> EitherShouldContain shouldContainOnOtherSide(Either<LEFT, RIGHT> either,
74-
Object expected) {
75-
return either.isRight()
76-
? new EitherShouldContain(EXPECTING_ON_THE_LEFT, either, expected, either.get())
77-
: new EitherShouldContain(EXPECTING_ON_THE_RIGHT, either, expected, either.getLeft());
78-
}
60+
/**
61+
* Indicates that the provided {@link io.vavr.control.Either} does not contain the provided argument on expected side.
62+
*
63+
* @param either the {@link io.vavr.control.Either} which contains a value.
64+
* @param expected the value we expect to be in the provided {@link io.vavr.control.Either}.
65+
* @param <LEFT> the type of the value contained in the {@link io.vavr.control.Either} on the left.
66+
* @param <RIGHT> the type of the value contained in the {@link io.vavr.control.Either} on the right.
67+
* @return an error message factory
68+
*/
69+
static <LEFT, RIGHT> EitherShouldContain shouldContainOnOtherSide(Either<LEFT, RIGHT> either,
70+
Object expected) {
71+
return either.isRight()
72+
? new EitherShouldContain(EXPECTING_ON_THE_LEFT, either, expected, either.get())
73+
: new EitherShouldContain(EXPECTING_ON_THE_RIGHT, either, expected, either.getLeft());
74+
}
7975

8076
/**
8177
* Indicates that the provided {@link Either} does not contain the provided argument as right value.
@@ -84,7 +80,6 @@ static <LEFT, RIGHT> EitherShouldContain shouldContainOnOtherSide(Either<LEFT, R
8480
* @param expectedValue the value we expect to be in the provided {@link Either} on the right side.
8581
* @param <LEFT> the type of the value contained in the {@link Either} on the left side.
8682
* @param <RIGHT> the type of the value contained in the {@link Either} on the right side.
87-
*
8883
* @return an error message factory
8984
*/
9085
static <LEFT, RIGHT> EitherShouldContain shouldContainOnRight(Either<LEFT, RIGHT> either, RIGHT expectedValue) {
@@ -101,7 +96,6 @@ static <LEFT, RIGHT> EitherShouldContain shouldContainOnRight(Either<LEFT, RIGHT
10196
* @param expectedValue the value we expect to be in the provided {@link Either} on the right side.
10297
* @param <LEFT> the type of the value contained in the {@link Either} on the left side.
10398
* @param <RIGHT> the type of the value contained in the {@link Either} on the right side.
104-
*
10599
* @return an error message factory
106100
*/
107101
static <LEFT, RIGHT> EitherShouldContain shouldContainSameOnRight(Either<LEFT, RIGHT> either, RIGHT expectedValue) {
@@ -117,14 +111,13 @@ static <LEFT, RIGHT> EitherShouldContain shouldContainSameOnRight(Either<LEFT, R
117111
* @param expectedValue the value we expect to be in the provided {@link Either} on the left side.
118112
* @param <LEFT> the type of the value contained in the {@link Either} on the left side.
119113
* @param <RIGHT> the type of the value contained in the {@link Either} on the right side.
120-
*
121114
* @return an error message factory
122115
*/
123116
static <LEFT, RIGHT> EitherShouldContain shouldContainOnLeft(Either<LEFT, RIGHT> either,
124-
LEFT expectedValue) {
117+
LEFT expectedValue) {
125118
return either.isLeft() ?
126-
new EitherShouldContain(EXPECTING_TO_CONTAIN, either, expectedValue) :
127-
shouldContainButIsRight(either, expectedValue);
119+
new EitherShouldContain(EXPECTING_TO_CONTAIN, either, expectedValue) :
120+
shouldContainButIsRight(either, expectedValue);
128121
}
129122

130123
/**
@@ -135,21 +128,19 @@ static <LEFT, RIGHT> EitherShouldContain shouldContainOnLeft(Either<LEFT, RIGHT>
135128
* @param expectedValue the value we expect to be in the provided {@link Either} on the left side.
136129
* @param <LEFT> the type of the value contained in the {@link Either} on the left side.
137130
* @param <RIGHT> the type of the value contained in the {@link Either} on the right side.
138-
*
139131
* @return an error message factory
140132
*/
141133
static <LEFT, RIGHT> EitherShouldContain shouldContainSameOnLeft(Either<LEFT, RIGHT> either,
142-
LEFT expectedValue) {
134+
LEFT expectedValue) {
143135
return either.isLeft() ?
144-
new EitherShouldContain(EXPECTING_TO_CONTAIN_SAME, either, expectedValue) :
145-
shouldContainButIsRight(either, expectedValue);
136+
new EitherShouldContain(EXPECTING_TO_CONTAIN_SAME, either, expectedValue) :
137+
shouldContainButIsRight(either, expectedValue);
146138
}
147139

148140
/**
149141
* Indicates that an {@link Either} is left so it doesn't contain the expected right value.
150142
*
151143
* @param expectedRightValue the right value we expect to be in an {@link Either}.
152-
*
153144
* @return an error message factory.
154145
*/
155146
static EitherShouldContain shouldContainButIsLeft(Either<?, ?> either, Object expectedRightValue) {
@@ -160,7 +151,6 @@ static EitherShouldContain shouldContainButIsLeft(Either<?, ?> either, Object ex
160151
* Indicates that an {@link Either} is right so it doesn't contain the expected left value.
161152
*
162153
* @param expectedRightValue the left value we expect to be in an {@link Either}.
163-
*
164154
* @return an error message factory.
165155
*/
166156
static EitherShouldContain shouldContainButIsRight(Either<?, ?> either, Object expectedRightValue) {

0 commit comments

Comments
 (0)