Package org.mockito

Examples of org.mockito.InOrder.verifyNoMoreInteractions()


    when(hasFileStructure.exists(dst)).thenReturn(false);
    transaction.prepare();
    InOrder inOrder = inOrder(hasFileStructure, transfersData);
    inOrder.verify(hasFileStructure).mkdirs(temp);
    inOrder.verify(transfersData).put(data, temp, dst);
    inOrder.verifyNoMoreInteractions();
  }

  public void prepare_destinationExists_noMoreInteractions() throws IOException {
    when(hasFileStructure.exists(dst)).thenReturn(true);
    transaction.prepare();
View Full Code Here


    InOrder inOrder = inOrder(transaction);
    inOrder.verify(transaction).prepare();
    inOrder.verify(transaction).commit();
    inOrder.verify(transaction).clean();
    inOrder.verifyNoMoreInteractions();
  }

  public void execute_prepareThrows_cleanButDontCommit() {
    doThrow(new RuntimeException()).when(transaction).prepare();
    try {
View Full Code Here

        PropertyChangeEvent expectedEvent = new PropertyChangeEvent(cfg, "primeNumber", "13", "17");
        InOrder inOrder = inOrder(propertyChangeListener);
        inOrder.verify(propertyChangeListener, times(1)).beforePropertyChange(argThat(matches(expectedEvent)));
        inOrder.verify(propertyChangeListener, times(1)).propertyChange(argThat(matches(expectedEvent)));
        inOrder.verifyNoMoreInteractions();
    }

    @Test
    public void testSetPropertyWhenValuesAreEqual() throws Throwable {
        MyConfig cfg = ConfigFactory.create(MyConfig.class);
View Full Code Here

        PropertyChangeEvent expectedEvent = new PropertyChangeEvent(cfg, "primeNumber", "13", "17");
        InOrder inOrder = inOrder(propertyChangeListener);
        inOrder.verify(propertyChangeListener, times(1)).beforePropertyChange(argThat(matches(expectedEvent)));
        inOrder.verify(propertyChangeListener, never()).propertyChange(argThat(matches(expectedEvent)));
        inOrder.verifyNoMoreInteractions();
    }


    @Test
    public void testRemoveProperty() throws Throwable {
View Full Code Here

        PropertyChangeEvent expectedEvent = new PropertyChangeEvent(cfg, "primeNumber", "13", null);

        InOrder inOrder = inOrder(propertyChangeListener);
        inOrder.verify(propertyChangeListener, times(1)).beforePropertyChange(argThat(matches(expectedEvent)));
        inOrder.verify(propertyChangeListener, times(1)).propertyChange(argThat(matches(expectedEvent)));
        inOrder.verifyNoMoreInteractions();
    }

    @Test
    public void testRemovePropertyThrowingRollbackOperationException() throws Throwable {
        doThrow(new RollbackOperationException()).when(propertyChangeListener).beforePropertyChange(any
View Full Code Here

        PropertyChangeEvent expectedEvent = new PropertyChangeEvent(cfg, "primeNumber", "13", "17");
        InOrder inOrder = inOrder(propertyChangeListener);
        inOrder.verify(propertyChangeListener, times(1)).beforePropertyChange(argThat(matches(expectedEvent)));
        inOrder.verify(propertyChangeListener, times(1)).propertyChange(argThat(matches(expectedEvent)));
        inOrder.verifyNoMoreInteractions();
    }


    @Test
    public void testClear() throws Throwable {
View Full Code Here

        PropertyChangeEvent expectedEvent = new PropertyChangeEvent(cfg, "primeNumber", "13", null);

        InOrder inOrder = inOrder(propertyChangeListener);
        inOrder.verify(propertyChangeListener, times(1)).beforePropertyChange(argThat(matches(expectedEvent)));
        inOrder.verify(propertyChangeListener, times(1)).propertyChange(argThat(matches(expectedEvent)));
        inOrder.verifyNoMoreInteractions();
    }

    @Test
    public void testClearOnRollbackOperationException() throws Throwable {
        MyConfig cfg = ConfigFactory.create(MyConfig.class);
View Full Code Here

        PropertyChangeEvent expectedEvent = new PropertyChangeEvent(cfg, "primeNumber", "13", null);

        InOrder inOrder = inOrder(propertyChangeListener);
        inOrder.verify(propertyChangeListener, times(1)).beforePropertyChange(argThat(matches(expectedEvent)));
        inOrder.verify(propertyChangeListener, never()).propertyChange(argThat(matches(expectedEvent)));
        inOrder.verifyNoMoreInteractions();
    }

    interface Server extends Mutable {

        @DefaultValue("localhost")
View Full Code Here

        PropertyChangeEvent expectedEvent = new PropertyChangeEvent(cfg, "hostname", "localhost", "google.com");
        InOrder inOrder = inOrder(propertyChangeListener);
        inOrder.verify(propertyChangeListener, times(1)).beforePropertyChange(argThat(matches(expectedEvent)));
        inOrder.verify(propertyChangeListener, times(1)).propertyChange(argThat(matches(expectedEvent)));
        inOrder.verifyNoMoreInteractions();
    }

    @Test
    public void testRemovePropertyChangeListenerWithPropertyName() throws Throwable {
        Server cfg = ConfigFactory.create(Server.class);
View Full Code Here

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.