Skip to content

Commit 9fc6a8f

Browse files
authored
s/isCancelled/isCanceled (#194)
1 parent de45436 commit 9fc6a8f

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

mongo/src/main/java/io/mincong/mongodb/model_changes/OrderV2.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public class OrderV2 {
2828
* <p>For existing documents which do not contain this field, the deserialization defaults to
2929
* `false`.
3030
*/
31-
@JsonProperty("isCancelled")
32-
private final boolean isCancelled;
31+
@JsonProperty("isCanceled")
32+
private final boolean isCanceled;
3333

3434
/**
3535
* This is a new operator.
@@ -54,15 +54,15 @@ public OrderV2(
5454
@JsonProperty("_id") String id,
5555
@JsonProperty("customerId") String customerId,
5656
@JsonProperty("amount") double amount,
57-
@JsonProperty("isCancelled") boolean isCancelled,
57+
@JsonProperty("isCanceled") boolean isCanceled,
5858
@JsonProperty("operator") String operator,
5959
@JsonProperty("productIds") List<String> productIds) {
6060
this.id = id;
6161
this.customerId = customerId;
6262
this.amount = amount;
6363

6464
// when missing value, defaults to `false`
65-
this.isCancelled = isCancelled;
65+
this.isCanceled = isCanceled;
6666

6767
// when missing value, handle null explicitly
6868
if (operator == null) {
@@ -91,8 +91,8 @@ public double getAmount() {
9191
return amount;
9292
}
9393

94-
public boolean getIsCancelled() {
95-
return isCancelled;
94+
public boolean getIsCanceled() {
95+
return isCanceled;
9696
}
9797

9898
@Override
@@ -103,14 +103,14 @@ public boolean equals(Object o) {
103103
return Double.compare(order.amount, amount) == 0
104104
&& Objects.equals(id, order.id)
105105
&& Objects.equals(customerId, order.customerId)
106-
&& Objects.equals(isCancelled, order.isCancelled)
106+
&& Objects.equals(isCanceled, order.isCanceled)
107107
&& Objects.equals(operator, order.operator)
108108
&& Objects.equals(productIds, order.productIds);
109109
}
110110

111111
@Override
112112
public int hashCode() {
113-
return Objects.hash(id, customerId, amount, isCancelled, operator, productIds);
113+
return Objects.hash(id, customerId, amount, isCanceled, operator, productIds);
114114
}
115115

116116
@Override
@@ -124,8 +124,8 @@ public String toString() {
124124
+ '\''
125125
+ ", amount="
126126
+ amount
127-
+ ", isCancelled="
128-
+ isCancelled
127+
+ ", isCanceled="
128+
+ isCanceled
129129
+ ", operator='"
130130
+ operator
131131
+ '\''

mongo/src/test/java/io/mincong/mongodb/model_changes/AddFieldIT.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ void it_should_deserialize_existing_order() {
4848
*
4949
* <p>"java.io.UncheckedIOException:
5050
* com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field
51-
* "isCancelled" (class io.mincong.mongodb.model_changes.OrderV1), not marked as ignorable (3
52-
* known properties: "amount", "customerId", "_id"]) at [Source: (String)"{"_id": "2",
53-
* "customerId": "Customer2", "amount": 200.0, "isCancelled": true, "operator":
54-
* "emea@example.com", "productIds": ["A", "B", "C"]}"; line: 1, column: 77] (through reference
55-
* chain: io.mincong.mongodb.model_changes.OrderV1["isCancelled"])"
51+
* "isCanceled" (class io.mincong.mongodb.model_changes.OrderV1), not marked as ignorable (3 known
52+
* properties: "amount", "customerId", "_id"]) at [Source: (String)"{"_id": "2", "customerId":
53+
* "Customer2", "amount": 200.0, "isCanceled": true, "operator": "emea@example.com", "productIds":
54+
* ["A", "B", "C"]}"; line: 1, column: 77] (through reference chain:
55+
* io.mincong.mongodb.model_changes.OrderV1["isCanceled"])"
5656
*/
5757
@Test
5858
void it_should_be_fine_when_revert_to_V1() {

0 commit comments

Comments
 (0)