use of com.sequenceiq.freeipa.service.freeipa.user.model.FmsUser in project cloudbreak by hortonworks.
the class FmsUserConverterTest method testMachineUserToFmsUserMissingNames.
@Test
public void testMachineUserToFmsUserMissingNames() {
String workloadUsername = "foobar";
UserManagementProto.MachineUser umsMachineUser = UserManagementProto.MachineUser.newBuilder().setWorkloadUsername(workloadUsername).setState(UserManagementProto.ActorState.Value.ACTIVE).build();
FmsUser fmsUser = underTest.toFmsUser(umsMachineUser);
assertEquals(workloadUsername, fmsUser.getName());
assertEquals(underTest.NONE_STRING, fmsUser.getFirstName());
assertEquals(underTest.NONE_STRING, fmsUser.getLastName());
assertEquals(FmsUser.State.ENABLED, fmsUser.getState());
}
use of com.sequenceiq.freeipa.service.freeipa.user.model.FmsUser in project cloudbreak by hortonworks.
the class FmsUserConverterTest method testUserSyncActorDetailsToFmsUserWithSpaces.
@Test
public void testUserSyncActorDetailsToFmsUserWithSpaces() {
String firstName = " Foo ";
String lastName = " Bar ";
String workloadUsername = "foobar";
UserManagementProto.UserSyncActorDetails actorDetails = UserManagementProto.UserSyncActorDetails.newBuilder().setFirstName(firstName).setLastName(lastName).setWorkloadUsername(workloadUsername).setState(UserManagementProto.ActorState.Value.ACTIVE).build();
FmsUser fmsUser = underTest.toFmsUser(actorDetails);
assertEquals("foobar", fmsUser.getName());
assertEquals("Foo", fmsUser.getFirstName());
assertEquals("Bar", fmsUser.getLastName());
assertEquals(FmsUser.State.ENABLED, fmsUser.getState());
}
use of com.sequenceiq.freeipa.service.freeipa.user.model.FmsUser in project cloudbreak by hortonworks.
the class FmsUserConverterTest method testUserSyncActorDetailsToFmsUser.
@Test
public void testUserSyncActorDetailsToFmsUser() {
String firstName = "Foo";
String lastName = "Bar";
String workloadUsername = "foobar";
UserManagementProto.UserSyncActorDetails actorDetails = UserManagementProto.UserSyncActorDetails.newBuilder().setFirstName(firstName).setLastName(lastName).setWorkloadUsername(workloadUsername).setState(UserManagementProto.ActorState.Value.ACTIVE).build();
FmsUser fmsUser = underTest.toFmsUser(actorDetails);
assertEquals(workloadUsername, fmsUser.getName());
assertEquals(firstName, fmsUser.getFirstName());
assertEquals(lastName, fmsUser.getLastName());
assertEquals(FmsUser.State.ENABLED, fmsUser.getState());
}
use of com.sequenceiq.freeipa.service.freeipa.user.model.FmsUser in project cloudbreak by hortonworks.
the class FmsUserConverterTest method testUserToFmsUserDeletingState.
@Test
public void testUserToFmsUserDeletingState() {
String workloadUsername = "foobar";
UserManagementProto.User umsUser = UserManagementProto.User.newBuilder().setWorkloadUsername(workloadUsername).setState(UserManagementProto.ActorState.Value.DELETING).build();
FmsUser fmsUser = underTest.toFmsUser(umsUser);
assertEquals(workloadUsername, fmsUser.getName());
assertEquals(underTest.NONE_STRING, fmsUser.getFirstName());
assertEquals(underTest.NONE_STRING, fmsUser.getLastName());
assertEquals(FmsUser.State.ENABLED, fmsUser.getState());
}
use of com.sequenceiq.freeipa.service.freeipa.user.model.FmsUser in project cloudbreak by hortonworks.
the class FmsUserConverterTest method testMachineUserToFmsUserDeactivatedState.
@Test
public void testMachineUserToFmsUserDeactivatedState() {
String workloadUsername = "foobar";
UserManagementProto.MachineUser umsMachineUser = UserManagementProto.MachineUser.newBuilder().setWorkloadUsername(workloadUsername).setState(UserManagementProto.ActorState.Value.DEACTIVATED).build();
FmsUser fmsUser = underTest.toFmsUser(umsMachineUser);
assertEquals(workloadUsername, fmsUser.getName());
assertEquals(underTest.NONE_STRING, fmsUser.getFirstName());
assertEquals(underTest.NONE_STRING, fmsUser.getLastName());
assertEquals(FmsUser.State.DISABLED, fmsUser.getState());
}
Aggregations