1+
12package com .commercetools .sdk ;
23
3- import com .commercetools .api .models .customer .Customer ;
4- import io .vrap .rmf .base .client .utils .json .JsonUtils ;
5- import org .junit .jupiter .api .Test ;
4+ import static com .commercetools .sdk .TestUtils .stringFromResource ;
5+ import static org .junit .jupiter .api .Assertions .*;
66
77import java .util .List ;
88
9- import static com .commercetools .sdk .TestUtils .stringFromResource ;
10- import static org .junit .jupiter .api .Assertions .*;
9+ import com .commercetools .api .models .customer .Customer ;
10+
11+ import io .vrap .rmf .base .client .utils .json .JsonUtils ;
12+
13+ import org .junit .jupiter .api .Test ;
1114
1215class CustomerUtilTest {
1316 private final CustomerUtil util = new CustomerUtil ();
1417
1518 @ Test
1619 void shouldMapRequiredFields () {
17- var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.example.json" ), Customer .class );
20+ var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.example.json" ),
21+ Customer .class );
1822 var result = util .toCustomerImport (customer );
1923
2024 assertEquals ("customer-key" , result .getKey ());
@@ -23,16 +27,18 @@ void shouldMapRequiredFields() {
2327
2428 @ Test
2529 void shouldMapCustomerGroupKeyFromExpandedObj () {
26- var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.example.json" ), Customer .class );
30+ var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.example.json" ),
31+ Customer .class );
2732 var result = util .toCustomerImport (customer );
2833
2934 assertNotNull (result .getCustomerGroup ());
30- assertEquals ("vip-group" , result .getCustomerGroup ().getKey ()); // catches getId() bug
35+ assertEquals ("vip-group" , result .getCustomerGroup ().getKey ()); // catches getId() bug
3136 }
3237
3338 @ Test
3439 void shouldMapAddressIndices () {
35- var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.example.json" ), Customer .class );
40+ var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.example.json" ),
41+ Customer .class );
3642 var result = util .toCustomerImport (customer );
3743
3844 // addr-0 is index 0, addr-1 is index 1
@@ -44,7 +50,8 @@ void shouldMapAddressIndices() {
4450
4551 @ Test
4652 void shouldMapAddresses () {
47- var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.example.json" ), Customer .class );
53+ var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.example.json" ),
54+ Customer .class );
4855 var result = util .toCustomerImport (customer );
4956
5057 assertEquals (2 , result .getAddresses ().size ());
@@ -53,7 +60,8 @@ void shouldMapAddresses() {
5360
5461 @ Test
5562 void shouldHandleNullCustomerGroup () {
56- var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.no-group.json" ), Customer .class );
63+ var customer = JsonUtils .fromJsonString (stringFromResource ("src/test/resources/customer.no-group.json" ),
64+ Customer .class );
5765 var result = util .toCustomerImport (customer );
5866 assertNull (result .getCustomerGroup ());
5967 }
0 commit comments