Esempio n. 1
0
  @Test
  public void deveriaSerDiferenteComHostnamesDiferentes() {
    // dado
    NodeStatus host1 = new NodeStatus("host1", "1.1.1.1", 1, 2, 3, 4);
    NodeStatus host2 = new NodeStatus("host2", "1.1.1.1", 1, 2, 3, 4);
    // quando
    boolean resultado = host1.equals(host2);

    // então
    assertThat(resultado, is(false));
  }
Esempio n. 2
0
  @Test
  public void deveriaSerIgualAoOutroComTodasPropriedadesIguais() {
    // dado
    NodeStatus host1 = new NodeStatus("host1", "1.1.1.1", 1, 2, 3, 4);
    NodeStatus host2 = new NodeStatus("host1", "1.1.1.1", 1, 2, 3, 4);

    // quando
    Boolean resultado = host1.equals(host2);

    // então
    assertThat(resultado, is(new Boolean(true)));
  }
Esempio n. 3
0
  @Test
  public void deveriaSerDiferenteComEnderecoIpDiferentes() {
    // dado
    NodeStatus host1 = new NodeStatus("host1", "1.1.1.1", 1, 2, 3, 4);
    NodeStatus host2 = new NodeStatus("host1", "2.2.2.2", 1, 2, 3, 4);

    // quando
    Boolean resultado = host1.equals(host2);

    // então
    assertThat(resultado, is(new Boolean(false)));
  }