Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/with-latest-snapshot-versions'
# Conflicts: # assertions-examples/pom.xml
- Loading branch information
Showing
16 changed files
with
280 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
assertions-examples/src/main/java/org/assertj/examples/data/ArtWork.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* Copyright 2012-2016 the original author or authors. | ||
*/ | ||
package org.assertj.examples.data; | ||
|
||
public class ArtWork { | ||
|
||
private String creator; | ||
|
||
public String getCreator() { | ||
return creator; | ||
} | ||
|
||
public void setCreator(String creator) { | ||
this.creator = creator; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...amples/src/test/generated-assertions/org/assertj/examples/data/AbstractArtWorkAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.assertj.examples.data; | ||
|
||
import org.assertj.core.api.AbstractAssert; | ||
import org.assertj.core.util.Objects; | ||
|
||
/** | ||
* Abstract base class for {@link ArtWork} specific assertions - Generated by CustomAssertionGenerator. | ||
*/ | ||
public abstract class AbstractArtWorkAssert<S extends AbstractArtWorkAssert<S, A>, A extends ArtWork> extends AbstractAssert<S, A> { | ||
|
||
/** | ||
* Creates a new <code>{@link AbstractArtWorkAssert}</code> to make assertions on actual ArtWork. | ||
* @param actual the ArtWork we want to make assertions on. | ||
*/ | ||
protected AbstractArtWorkAssert(A actual, Class<S> selfType) { | ||
super(actual, selfType); | ||
} | ||
|
||
/** | ||
* Verifies that the actual ArtWork's creator is equal to the given one. | ||
* @param creator the given creator to compare the actual ArtWork's creator to. | ||
* @return this assertion object. | ||
* @throws AssertionError - if the actual ArtWork's creator is not equal to the given one. | ||
*/ | ||
public S hasCreator(String creator) { | ||
// check that actual ArtWork we want to make assertions on is not null. | ||
isNotNull(); | ||
|
||
|
||
// overrides the default error message with a more explicit one | ||
String assertjErrorMessage = "\nExpecting creator of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; | ||
|
||
// check | ||
String actualCreator = actual.getCreator(); | ||
System.out.println("check Creator"); | ||
if (!Objects.areEqual(actualCreator, creator)) { | ||
failWithMessage(assertjErrorMessage, actual, creator, actualCreator); | ||
} | ||
|
||
// return the current assertion for method chaining | ||
return myself; | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
...tions-examples/src/test/generated-assertions/org/assertj/examples/data/ArtWorkAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.assertj.examples.data; | ||
|
||
|
||
/** | ||
* {@link ArtWork} specific assertions - Generated by me. | ||
* | ||
* Although this class is not final to allow Soft assertions proxy, if you wish to extend it, | ||
* extend {@link AbstractArtWorkAssert} instead. | ||
*/ | ||
public class ArtWorkAssert extends AbstractArtWorkAssert<ArtWorkAssert, ArtWork> { | ||
|
||
/** | ||
* Creates a new <code>{@link ArtWorkAssert}</code> to make assertions on actual ArtWork. | ||
* @param actual the ArtWork we want to make assertions on. | ||
*/ | ||
public ArtWorkAssert(ArtWork actual) { | ||
super(actual, ArtWorkAssert.class); | ||
} | ||
|
||
/** | ||
* factory method for ArtWork assertions. | ||
* @return a new <code>{@link ArtWorkAssert}</code> | ||
*/ | ||
public static ArtWorkAssert assertThat(ArtWork actual) { | ||
return new ArtWorkAssert(actual); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...es/src/test/generated-assertions/org/assertj/examples/data/movie/AbstractMovieAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.