Package org.mockito.internal.progress

Source Code of org.mockito.internal.progress.ThreadSafeMockingProgressTest

/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.progress;

import org.junit.After;
import org.junit.Test;
import org.mockito.internal.verification.DummyVerificationMode;
import org.mockitoutil.TestBase;

import java.util.List;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

public class ThreadSafeMockingProgressTest extends TestBase {

    @After
    public void after() {
        this.resetState();
    }

    @Test
    public void shouldShareState() throws Exception {
        //given
        ThreadSafeMockingProgress p = new ThreadSafeMockingProgress();
        p.verificationStarted(new DummyVerificationMode());

        //then
        p = new ThreadSafeMockingProgress();
        assertNotNull(p.pullVerificationMode());
    }

    @Test
    public void shouldKnowWhenVerificationHasStarted() throws Exception {
        //given
        verify(mock(List.class));
        ThreadSafeMockingProgress p = new ThreadSafeMockingProgress();

        //then
        assertNotNull(p.pullVerificationMode());
    }
}
TOP

Related Classes of org.mockito.internal.progress.ThreadSafeMockingProgressTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.