Skip to content

Commit fc5bb3f

Browse files
committed
DATAMONGO-1578 - Polishing.
Add ticket references to test methods. Extend license years in copyright header. Original pull request: #398.
1 parent d4d9c76 commit fc5bb3f

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2016 the original author or authors.
2+
* Copyright 2013-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,11 +55,17 @@ public class ProjectionOperationUnitTests {
5555
static final String DIVIDE = "$divide";
5656
static final String PROJECT = "$project";
5757

58+
/**
59+
* @see DATAMONGO-586
60+
*/
5861
@Test(expected = IllegalArgumentException.class)
5962
public void rejectsNullFields() {
6063
new ProjectionOperation(null);
6164
}
6265

66+
/**
67+
* @see DATAMONGO-586
68+
*/
6369
@Test
6470
public void declaresBackReferenceCorrectly() {
6571

@@ -71,6 +77,9 @@ public void declaresBackReferenceCorrectly() {
7177
assertThat(projectClause.get("prop"), is((Object) Fields.UNDERSCORE_ID_REF));
7278
}
7379

80+
/**
81+
* @see DATAMONGO-586
82+
*/
7483
@Test
7584
public void alwaysUsesExplicitReference() {
7685

@@ -83,6 +92,9 @@ public void alwaysUsesExplicitReference() {
8392
assertThat(projectClause.get("bar"), is((Object) "$foobar"));
8493
}
8594

95+
/**
96+
* @see DATAMONGO-586
97+
*/
8698
@Test
8799
public void aliasesSimpleFieldProjection() {
88100

@@ -94,6 +106,9 @@ public void aliasesSimpleFieldProjection() {
94106
assertThat(projectClause.get("bar"), is((Object) "$foo"));
95107
}
96108

109+
/**
110+
* @see DATAMONGO-586
111+
*/
97112
@Test
98113
public void aliasesArithmeticProjection() {
99114

@@ -109,6 +124,9 @@ public void aliasesArithmeticProjection() {
109124
assertThat(addClause.get(1), is((Object) 41));
110125
}
111126

127+
/**
128+
* @see DATAMONGO-586
129+
*/
112130
@Test
113131
public void arithmenticProjectionOperationWithoutAlias() {
114132

@@ -122,6 +140,9 @@ public void arithmenticProjectionOperationWithoutAlias() {
122140
assertThat(oper.get(ADD), is((Object) Arrays.<Object> asList("$a", 1)));
123141
}
124142

143+
/**
144+
* @see DATAMONGO-586
145+
*/
125146
@Test
126147
public void arithmenticProjectionOperationPlus() {
127148

@@ -136,6 +157,9 @@ public void arithmenticProjectionOperationPlus() {
136157
assertThat(oper.get(ADD), is((Object) Arrays.<Object> asList("$a", 1)));
137158
}
138159

160+
/**
161+
* @see DATAMONGO-586
162+
*/
139163
@Test
140164
public void arithmenticProjectionOperationMinus() {
141165

@@ -150,6 +174,9 @@ public void arithmenticProjectionOperationMinus() {
150174
assertThat(oper.get(SUBTRACT), is((Object) Arrays.<Object> asList("$a", 1)));
151175
}
152176

177+
/**
178+
* @see DATAMONGO-586
179+
*/
153180
@Test
154181
public void arithmenticProjectionOperationMultiply() {
155182

@@ -164,6 +191,9 @@ public void arithmenticProjectionOperationMultiply() {
164191
assertThat(oper.get(MULTIPLY), is((Object) Arrays.<Object> asList("$a", 1)));
165192
}
166193

194+
/**
195+
* @see DATAMONGO-586
196+
*/
167197
@Test
168198
public void arithmenticProjectionOperationDivide() {
169199

@@ -178,12 +208,18 @@ public void arithmenticProjectionOperationDivide() {
178208
assertThat(oper.get(DIVIDE), is((Object) Arrays.<Object> asList("$a", 1)));
179209
}
180210

211+
/**
212+
* @see DATAMONGO-586
213+
*/
181214
@Test(expected = IllegalArgumentException.class)
182215
public void arithmenticProjectionOperationDivideByZeroException() {
183216

184217
new ProjectionOperation().and("a").divide(0);
185218
}
186219

220+
/**
221+
* @see DATAMONGO-586
222+
*/
187223
@Test
188224
public void arithmenticProjectionOperationMod() {
189225

0 commit comments

Comments
 (0)