Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 5555b65

Browse files
author
Barbara Palumbo
committed
fixed the update action and test added
1 parent 457b88f commit 5555b65

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

commercetools-models/src/main/java/io/sphere/sdk/customers/commands/updateactions/SetAuthenticationMode.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@
1414
* {@include.example io.sphere.sdk.customers.commands.CustomerUpdateCommandIntegrationTest#setAuthenticationMode()}
1515
*/
1616
public final class SetAuthenticationMode extends UpdateActionImpl<Customer> {
17-
private final AuthenticationMode authenticationMode;
17+
private final AuthenticationMode authMode;
1818
@Nullable
1919
private final String password;
2020

21-
private SetAuthenticationMode(final AuthenticationMode authenticationMode, @Nullable final String password) {
21+
private SetAuthenticationMode(final AuthenticationMode authMode, @Nullable final String password) {
2222
super("setAuthenticationMode");
23-
this.authenticationMode = authenticationMode;
23+
this.authMode = authMode;
2424
this.password = password;
2525
}
2626

27-
public static SetAuthenticationMode of(final AuthenticationMode authenticationMode, @Nullable final String password) {
28-
return new SetAuthenticationMode(authenticationMode, password);
27+
public static SetAuthenticationMode of(final AuthenticationMode authMode, @Nullable final String password) {
28+
return new SetAuthenticationMode(authMode, password);
2929
}
3030

31-
public AuthenticationMode getAuthenticationMode() {
32-
return authenticationMode;
31+
public AuthenticationMode getAuthMode() {
32+
return authMode;
3333
}
3434

3535
@Nullable

commercetools-models/src/test/java/io/sphere/sdk/customers/commands/CustomerUpdateCommandIntegrationTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,18 @@ public void setVatId() throws Exception {
364364
});
365365
}
366366

367+
@Test
368+
public void setAuthenticationMode() throws Exception {
369+
withUpdateableCustomer(client(), customer -> {
370+
CustomerUpdateCommand update = CustomerUpdateCommand.of(customer, SetAuthenticationMode.of(AuthenticationMode.EXTERNAL_AUTH, null));
371+
final Customer updatedCustomer = client().executeBlocking(update);
372+
373+
assertThat(updatedCustomer.getAuthenticationMode()).isEqualTo(AuthenticationMode.EXTERNAL_AUTH);
374+
375+
return updatedCustomer;
376+
});
377+
}
378+
367379
@Test
368380
public void setDateOfBirth() throws Exception {
369381
withCustomer(client(), customer -> {

0 commit comments

Comments
 (0)