package com.github.tomitakussaari.phaas.api;

import com.github.tomitakussaari.phaas.user.UsersService;
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.core.env.Environment;

import static org.mockito.Mockito.when;

public class UsersApiTest {

    private final UsersService usersService = Mockito.mock(UsersService.class);
    private final Environment environment = Mockito.mock(Environment.class);
    private final UsersApi usersApi = new UsersApi(usersService, environment);

    @Test
    public void equalsContractForPublicUser() {
        EqualsVerifier.forClass(UsersApi.PublicUser.class)
                .suppress(Warning.NONFINAL_FIELDS, Warning.NULL_FIELDS, Warning.STRICT_INHERITANCE)
                .verify();
    }

    @Test(expected = OperationIsNotAvailableException.class)
    public void newUserCreationCanBePreventedWithConfiguration() {
        when(environment.getProperty("immutable.users.db", Boolean.class)).thenReturn(true);
        usersApi.createUser(null);
    }

    @Test(expected = OperationIsNotAvailableException.class)
    public void userDeletionCanBePreventedWithConfiguration() {
        when(environment.getProperty("immutable.users.db", Boolean.class)).thenReturn(true);
        usersApi.deleteUser("");
    }

    @Test(expected = OperationIsNotAvailableException.class)
    public void schemeChangeCanBePreventedWithConfiguration() {
        when(environment.getProperty("immutable.users.db", Boolean.class)).thenReturn(true);
        usersApi.newProtectionScheme(null, null);
    }

    @Test(expected = OperationIsNotAvailableException.class)
    public void passwordChangeCanBePreventedWithConfiguration() {
        when(environment.getProperty("immutable.users.db", Boolean.class)).thenReturn(true);
        usersApi.changePassword(null, null);
    }

}
@@ -590,16 +590,283 @@
 ment);%0A%0A
+    @Test%0A    public void equalsContractForNewPasswordRequest() %7B%0A        EqualsVerifier.forClass(UsersApi.NewPasswordRequest.class)%0A                .suppress(Warning.NONFINAL_FIELDS, Warning.NULL_FIELDS, Warning.STRICT_INHERITANCE)%0A                .verify();%0A    %7D%0A%0A
     @Tes

Add missing testcase