Example #1
0
  @Test
  public void inicializa_casoConexaoNaoEstejaClosed() throws Exception {
    when(conexao.isClosed()).thenReturn(false);

    assertEquals(conexao, comando.getConexao());
    verify(comando, never()).inicializa();
  }
Example #2
0
 @Test
 public void naoInicializa_casoConexaoNaoEstejaNull() throws Exception {
   assertEquals(conexao, comando.getConexao());
   verify(comando, never()).inicializa();
 }
Example #3
0
 @Before
 public void setup() throws Exception {
   doNothing().when(comando).inicializa();
   when(comando.getConexao()).thenReturn(conexao);
 }