org.assertj.db.navigation.ToValueFromColumn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-db Show documentation
Show all versions of assertj-db Show documentation
AssertJ-DB - Rich and fluent assertions for testing with database
/*
* 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 2015-2020 the original author or authors.
*/
package org.assertj.db.navigation;
import org.assertj.db.navigation.element.ValueElement;
/**
* Defines methods to navigate to a value from a {@link org.assertj.db.type.Column}
* (a column from a {@link org.assertj.db.type.Change}}.
* The different methods return an assertion on one value {@link org.assertj.db.navigation.element.ValueElement}.
* These methods exists when navigating (at the beginning {@code assertThat()}) from changes.
* As shown in the diagram below, if navigating from changes, it is possible to call the method to navigate to a {@link org.assertj.db.navigation.element.ColumnElement} from :
*
* - a column of a change ({@link org.assertj.db.api.ChangeColumnAssert})
* - a value of a column of a change ({@link org.assertj.db.api.ChangeColumnValueAssert})
*
*
*
*
* It is important to keep in mind that the methods are executed from the point of view of the last instance with assertion methods on a column of a change ({@link org.assertj.db.api.ChangeAssert}).
* So all the lines of code below are equivalent : they point on the value at end point of first column.
*
*
*
* assertThat(changes).change().column().valueAtEndPoint()......; // Point directly on the value at end point
* // Use the returnToColumn() method to return on the column and access to the value at the end point
* assertThat(changes).change().column().valueAtStartPoint().returnToColumn().valueAtEndPoint()......;
* assertThat(changes).change().column().valueAtStartPoint().valueAtEndPoint()......; // Same as precedent but returnToColumn() is implicit
* assertThat(changes).change().row().value().change(0).column().valueAtEndPoint()......;
* // Equivalent to the precedent but with the use of the methods to return to origin
* assertThat(changes).change().row().value().returnToRow().returnToChange().returnToChanges().change(0).column().value(1)......;
*
*
*
* @author Régis Pouiller
*
* @param The class of a assertion on a value (an sub-class of {@link org.assertj.db.navigation.element.ValueElement}).
*/
public interface ToValueFromColumn extends Navigation {
/**
* Returns assertion methods on the value at the start point.
*
* @return An object to make assertions on the next value.
* @see org.assertj.db.api.ChangeColumnAssert#valueAtStartPoint
* @see org.assertj.db.api.ChangeColumnValueAssert#valueAtStartPoint
*/
V valueAtStartPoint();
/**
* Returns assertion methods on the value at the end point.
*
* @return An object to make assertions on the value.
* @see org.assertj.db.api.ChangeColumnAssert#valueAtEndPoint
* @see org.assertj.db.api.ChangeColumnValueAssert#valueAtEndPoint
*/
V valueAtEndPoint();
}