Skip to content

Commit 42d3dfe

Browse files
committed
Polishing.
Adding `@author` tag and a test. Closes #916
1 parent bea7198 commit 42d3dfe

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Conditions.java

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*
2727
* @author Mark Paluch
2828
* @author Jens Schauder
29+
* @author Meng Zuozhu
2930
* @since 1.1
3031
* @see SQL
3132
* @see Expressions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package org.springframework.data.relational.core.sql;
2+
3+
import static org.assertj.core.api.Assertions.*;
4+
5+
import java.util.ArrayList;
6+
import java.util.List;
7+
8+
import org.junit.jupiter.api.Test;
9+
10+
/*
11+
* Copyright 2021 the original author or authors.
12+
*
13+
* Licensed under the Apache License, Version 2.0 (the "License");
14+
* you may not use this file except in compliance with the License.
15+
* You may obtain a copy of the License at
16+
*
17+
* https://www.apache.org/licenses/LICENSE-2.0
18+
*
19+
* Unless required by applicable law or agreed to in writing, software
20+
* distributed under the License is distributed on an "AS IS" BASIS,
21+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22+
* See the License for the specific language governing permissions and
23+
* limitations under the License.
24+
*/
25+
class ConditionsUnitTests {
26+
27+
@Test // gh-916
28+
void notInOfColumnAndExpression() {
29+
30+
Table table = Table.create("t");
31+
Column column = Column.create("col", table);
32+
Expression expression = new Literal<>("expression");
33+
34+
In notIn = Conditions.notIn(column, expression);
35+
36+
List<Visitable> segments = new ArrayList<>();
37+
notIn.visit(segments::add);
38+
39+
assertThat(notIn.isNotIn()).isTrue();
40+
assertThat(segments).containsExactly(notIn, column, table, expression);
41+
}
42+
}

0 commit comments

Comments
 (0)