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

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


  }

  @Test
  public void crudTypedB() {
    // create
    final CapabilityB created = capabilities().create(CapabilityB.class)
        .withNotes("Some notes")
        .withPropertyB1("foo")
        .save();

    assertThat(created.id(), is(notNullValue()));
    assertThat(created.notes(), is("Some notes"));
    assertThat(created.property("b1"), is("foo"));
    assertThat(created.propertyB1(), is("foo"));

    // read
    final CapabilityB read = capabilities().get(CapabilityB.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.propertyB1(), is(created.propertyB1()));

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

    final CapabilityB updated = capabilities().get(CapabilityB.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


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

  @Test
  public void enableAndDisableTypedB() {
    final CapabilityB created = capabilities().create(CapabilityB.class)
        .withNotes("Some notes")
        .withPropertyB1("foo")
        .save();

    final CapabilityB read = capabilities().get(CapabilityB.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

    read.save();
  }

  @Test
  public void updateInexistentTypedB() {
    final CapabilityB created = capabilities().create(CapabilityB.class)
        .withNotes("Some notes")
        .withPropertyB1("foo")
        .save();

    final CapabilityB read = capabilities().get(CapabilityB.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.remove();
  }

  @Test
  public void deleteInexistentTypedB() {
    final CapabilityB created = capabilities().create(CapabilityB.class)
        .withNotes("Some notes")
        .withPropertyB1("foo")
        .save();

    final CapabilityB read = capabilities().get(CapabilityB.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.CapabilityB

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.