mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Inline conditions in assertThat() statements
Search: assertThat\(conditions?[0-9]?\) See gh-36504
This commit is contained in:
@@ -117,8 +117,7 @@ class JdbcTemplateTests {
|
||||
assertThat(this.template.getDataSource()).as("datasource ok").isSameAs(this.dataSource);
|
||||
assertThat(this.template.isIgnoreWarnings()).as("ignores warnings by default").isTrue();
|
||||
this.template.setIgnoreWarnings(false);
|
||||
boolean condition = !this.template.isIgnoreWarnings();
|
||||
assertThat(condition).as("can set NOT to ignore warnings").isTrue();
|
||||
assertThat(!this.template.isIgnoreWarnings()).as("can set NOT to ignore warnings").isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1126,8 +1125,7 @@ class JdbcTemplateTests {
|
||||
given(this.callableStatement.getUpdateCount()).willReturn(-1);
|
||||
given(this.callableStatement.getObject(1)).willReturn("X");
|
||||
|
||||
boolean condition = !this.template.isResultsMapCaseInsensitive();
|
||||
assertThat(condition).as("default should have been NOT case insensitive").isTrue();
|
||||
assertThat(!this.template.isResultsMapCaseInsensitive()).as("default should have been NOT case insensitive").isTrue();
|
||||
|
||||
this.template.setResultsMapCaseInsensitive(true);
|
||||
assertThat(this.template.isResultsMapCaseInsensitive()).as("now it should have been set to case insensitive").isTrue();
|
||||
|
||||
+1
-2
@@ -94,8 +94,7 @@ class CallMetaDataContextTests {
|
||||
assertThat(inParameters).as("Wrong number of matched in parameter values").hasSize(2);
|
||||
assertThat(inParameters.containsKey("id")).as("in parameter value missing").isTrue();
|
||||
assertThat(inParameters.containsKey("name")).as("in out parameter value missing").isTrue();
|
||||
boolean condition = !inParameters.containsKey("customer_no");
|
||||
assertThat(condition).as("out parameter value matched").isTrue();
|
||||
assertThat(!inParameters.containsKey("customer_no")).as("out parameter value matched").isTrue();
|
||||
|
||||
List<String> names = context.getOutParameterNames();
|
||||
assertThat(names).as("Wrong number of out parameters").hasSize(2);
|
||||
|
||||
+4
-8
@@ -104,14 +104,10 @@ class TableMetaDataContextTests {
|
||||
List<Object> values = context.matchInParameterValuesWithInsertColumns(map);
|
||||
|
||||
assertThat(values.size()).as("wrong number of parameters: ").isEqualTo(4);
|
||||
boolean condition3 = values.get(0) instanceof Number;
|
||||
assertThat(condition3).as("id not wrapped with type info").isTrue();
|
||||
boolean condition2 = values.get(1) instanceof String;
|
||||
assertThat(condition2).as("name not wrapped with type info").isTrue();
|
||||
boolean condition1 = values.get(2) instanceof SqlParameterValue;
|
||||
assertThat(condition1).as("date wrapped with type info").isTrue();
|
||||
boolean condition = values.get(3) instanceof SqlParameterValue;
|
||||
assertThat(condition).as("version wrapped with type info").isTrue();
|
||||
assertThat(values.get(0) instanceof Number).as("id not wrapped with type info").isTrue();
|
||||
assertThat(values.get(1) instanceof String).as("name not wrapped with type info").isTrue();
|
||||
assertThat(values.get(2) instanceof SqlParameterValue).as("date wrapped with type info").isTrue();
|
||||
assertThat(values.get(3) instanceof SqlParameterValue).as("version wrapped with type info").isTrue();
|
||||
verify(metaDataResultSet, atLeastOnce()).next();
|
||||
verify(columnsResultSet, atLeastOnce()).next();
|
||||
verify(metaDataResultSet).close();
|
||||
|
||||
Reference in New Issue
Block a user