package de.example.services.impl;
+import java.util.Objects;
+
import de.example.model.mapper.UsersMapper;
import de.example.model.resource.UserResource;
import de.example.services.UsersService;
@Override
public void create(final UserResource user) {
+ Objects.requireNonNull(user, "user");
+
this.spiedMethod(user);
usersMapper.create(user);
assertEquals(expectedUser, newUser);
}
+ @Test(expected=NullPointerException.class)
+ public void givenNoUserDataWhenCreateNewUserThenThrowNullPointerException() {
+ // Act
+ usersService.create(null);
+ }
+
@Test
public void givenNewUserDataWhenCreateNewUserThenCreateUserWithArgumentCaptor() {
// Arrange