/*
 * Copyright (C) 2016 the original author or authors.
 *
 * This file is part of jBB Application Project.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  You may obtain a copy of the License at
 *        http://www.apache.org/licenses/LICENSE-2.0
 */

package org.jbb.members.web;

import org.jbb.lib.mvc.properties.MvcProperties;
import org.jbb.lib.mvc.security.SecurityContextHelper;
import org.jbb.members.api.service.MemberService;
import org.jbb.members.api.service.RegistrationService;
import org.jbb.security.api.service.PasswordService;
import org.mockito.Mockito;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import java.text.SimpleDateFormat;

import static org.mockito.Mockito.when;

@Configuration
public class MembersConfigMock {
    @Bean
    @Primary
    public RegistrationService registrationService() {
        return Mockito.mock(RegistrationService.class);
    }

    @Bean
    @Primary
    public MemberService memberService() {
        return Mockito.mock(MemberService.class);
    }

    @Bean
    @Primary
    public PasswordService passwordService() {
        return Mockito.mock(PasswordService.class);
    }

    @Bean
    @Primary
    public MvcProperties mvcProperties() {
        MvcProperties prop = Mockito.mock(MvcProperties.class);
        when(prop.localDateTimeFormatPattern()).thenReturn(new SimpleDateFormat().toLocalizedPattern());
        return prop;
    }

    @Bean
    @Primary
    public SecurityContextHelper securityContextHelper() {
        return Mockito.mock(SecurityContextHelper.class);
    }
}

@@ -560,32 +560,81 @@
 asswordService;%0A
+import org.jbb.security.api.service.RoleService;%0A
 import org.mocki
@@ -1324,32 +1324,149 @@
 .class);%0A    %7D%0A%0A
+    @Bean%0A    @Primary%0A    public RoleService roleService() %7B%0A        return Mockito.mock(RoleService.class);%0A    %7D%0A%0A
     @Bean%0A    @P

Fix integration tests