File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
main/java/com/stripe/model
test/java/com/stripe/model Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ private boolean apiVersionMatch() {
195
195
// Trim the locally configured API version to not include beta headers, since the payload won't
196
196
// have any.
197
197
String localApiVersion = StringUtils .trimApiVersion (Stripe .stripeVersion );
198
- return localApiVersion .equals (this .apiVersion );
198
+ return localApiVersion .equals (StringUtils . trimApiVersion ( this .apiVersion ) );
199
199
}
200
200
201
201
/**
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ public void testFailureOnApiVersionMisMatch() throws Exception {
143
143
}
144
144
145
145
@ Test
146
- public void testIgnoresBetaHeadersWhenDeterminingMatch () throws Exception {
146
+ public void testIgnoresBetaHeadersInLibraryVersionWhenDeterminingMatch () throws Exception {
147
147
final String data = getCurrentEventStringFixture ();
148
148
final Event event = ApiResource .GSON .fromJson (data , Event .class );
149
149
@@ -156,6 +156,19 @@ public void testIgnoresBetaHeadersWhenDeterminingMatch() throws Exception {
156
156
verifyDeserializedStripeObject (deserializer .getObject ().get ());
157
157
}
158
158
159
+ @ Test
160
+ public void testIgnoresBetaHeadersInEventVersionWhenDeterminingMatch () throws Exception {
161
+ final String data = getCurrentEventStringFixture ();
162
+ final Event event = ApiResource .GSON .fromJson (data , Event .class );
163
+ event .apiVersion = CURRENT_EVENT_VERSION + "; some_beta=v1; some_beta=v2" ;
164
+
165
+ Stripe .stripeVersion = CURRENT_EVENT_VERSION ;
166
+ EventDataObjectDeserializer deserializer = event .getDataObjectDeserializer ();
167
+
168
+ assertTrue (deserializer .getObject ().isPresent ());
169
+ verifyDeserializedStripeObject (deserializer .getObject ().get ());
170
+ }
171
+
159
172
@ Test
160
173
public void testApiVersionMismatchReportedEvenWhenBetaHeadersPresent () throws Exception {
161
174
final String data = getCurrentEventStringFixture ();
You can’t perform that action at this time.
0 commit comments