Package org.sonatype.nexus.testsuite.capabilities.client

Examples of org.sonatype.nexus.testsuite.capabilities.client.CapabilityA


  }

  @Test
  public void crudTypedA() {
    // create
    final CapabilityA created = capabilities().create(CapabilityA.class)
        .withNotes("Some notes")
        .withPropertyA1("foo")
        .save();

    assertThat(created.id(), is(notNullValue()));
    assertThat(created.notes(), is("Some notes"));
    assertThat(created.property("a1"), is("foo"));
    assertThat(created.propertyA1(), is("foo"));

    // read
    final CapabilityA read = capabilities().get(CapabilityA.class, created.id());

    assertThat(read.id(), is(created.id()));
    assertThat(read.notes(), is(created.notes()));
    assertThat(read.type(), is(created.type()));
    assertThat(read.properties(), is(created.properties()));
    assertThat(read.propertyA1(), is(created.propertyA1()));

    // update
    read.withNotes("Some other notes").save();

    final CapabilityA updated = capabilities().get(CapabilityA.class, created.id());

    assertThat(updated.notes(), is("Some other notes"));
    assertThat(created.refresh().notes(), is("Some other notes"));

    // delete
    read.remove();
View Full Code Here


    capabilities().get(CapabilityB.class, created.id());
  }

  @Test
  public void enableAndDisableTypedA() {
    final CapabilityA created = capabilities().create(CapabilityA.class)
        .withNotes("Some notes")
        .withPropertyA1("foo")
        .save();

    final CapabilityA read = capabilities().get(CapabilityA.class, created.id());

    assertThat(read.isEnabled(), is(true));

    created.disable();
    read.refresh();

    assertThat(read.isEnabled(), is(false));

    created.enable();
    read.refresh();

    assertThat(read.isEnabled(), is(true));
  }
View Full Code Here

    capabilities().get(CapabilityB.class, "getInexistent");
  }

  @Test
  public void updateInexistentTypedA() {
    final CapabilityA created = capabilities().create(CapabilityA.class)
        .withNotes("Some notes")
        .withPropertyA1("foo")
        .save();

    final CapabilityA read = capabilities().get(CapabilityA.class, created.id());
    created.remove();

    thrown.expect(UniformInterfaceException.class);
    thrown.expectMessage(String.format("Capability with id '%s' was not found", created.id()));
    read.save();
  }
View Full Code Here

    read.save();
  }

  @Test
  public void deleteInexistentTypedA() {
    final CapabilityA created = capabilities().create(CapabilityA.class)
        .withNotes("Some notes")
        .withPropertyA1("foo")
        .save();

    final CapabilityA read = capabilities().get(CapabilityA.class, created.id());
    created.remove();

    thrown.expect(UniformInterfaceException.class);
    thrown.expectMessage(String.format("Capability with id '%s' was not found", created.id()));
    read.remove();
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.testsuite.capabilities.client.CapabilityA

Copyright © 2018 www.massapicom. 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.