Examples of create()


Examples of org.sonar.wsclient.issue.ActionPlanClient.create()

  public void should_create_action_plan() throws Exception {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    ActionPlan result = client.create(
      NewActionPlan.create().name("Short term").project("org.sonar.Sample").description("Short term issues").deadLine(stringToDate("2014-01-01")));

    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/create");
    assertThat(httpServer.requestParams()).includes(
      entry("project", "org.sonar.Sample"),

Examples of org.sonar.wsclient.project.ProjectClient.create()

    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());

    httpServer.stubResponseBody("{\"id\":\"1\",\"k\":\"polop\",\"nm\":\"Polop\",\"sc\":\"PRJ\",\"qu\":\"TRK\"}");

    ProjectClient client = new DefaultProjectClient(requestFactory);
    Project result = client.create(NewProject.create().key("polop").name("Polop"));

    assertThat(httpServer.requestedPath()).isEqualTo("/api/projects/create");
    assertThat(httpServer.requestParams()).includes(
      entry("key", "polop"),
      entry("name", "Polop")

Examples of org.sonatype.maven.shell.maven.MavenRuntime.create()

        }

        customize(config);

        MavenRuntime runtime = maven.create(config);
        MavenExecutionRequest request = runtime.create();

        if (offline != null) {
            request.setOffline(offline);
        }
        if (goals != null) {

Examples of org.sonatype.nexus.capability.CapabilityFactory.create()

    final ValidatorRegistryProvider validatorRegistryProvider = mock(ValidatorRegistryProvider.class);
    final ValidatorRegistry validatorRegistry = mock(ValidatorRegistry.class);
    when(validatorRegistryProvider.get()).thenReturn(validatorRegistry);

    final CapabilityFactory factory = mock(CapabilityFactory.class);
    when(factory.create()).thenAnswer(new Answer<Capability>()
    {
      @Override
      public Capability answer(final InvocationOnMock invocation)
          throws Throwable
      {

Examples of org.sonatype.nexus.client.core.subsystem.security.Privilege.create()

        .withMethods("read")
        .withRepositoryGroupId("public")
        .withTargetId(targetId)
        .create().iterator().next();

    saved.create();
  }

  @Test(expected = UnsupportedOperationException.class)
  public void unsupportedUpdatePrivilege() {
    final String targetId = createRepoTarget("unsupportedUpdatePrivileges").id();

Examples of org.sonatype.nexus.client.core.subsystem.security.Roles.create()

    final Roles roles = client().getSubsystem(Roles.class);
    try {
      roles.get("kenai-base-role");
    }
    catch (NexusClientNotFoundException e) {
      roles.create("kenai-base-role")
          .withName("Kenai Base Role")
          .withDescription("Kenai Base Role")
          .withRole("nx-admin")
          .save();
    }

Examples of org.sonatype.nexus.client.core.subsystem.security.Users.create()

   */
  @Test
  public void testUserWithSingleQuotePassword() {
    Users users = client().getSubsystem(Users.class);
    String password = "\"";
    users.create("test").withPassword(password).withRole("nx-admin").withEmail("no@where.com").save();
    NexusClient client = createNexusClient(nexus(), "test", password);
    //will fail if can't authenticate
    Assert.assertThat(client.getNexusStatus(), Is.is(notNullValue()));
  }

Examples of org.sonatype.nexus.httpclient.HttpClientFactory.create()

  private KenaiRealm getRealm()
      throws Exception
  {
    final HttpClientFactory mockHttpClientFactory = Mockito.mock(HttpClientFactory.class);
    Mockito.when(mockHttpClientFactory.create()).thenReturn(new DefaultHttpClient());
    return new KenaiRealm(getKenaiRealmConfiguration(), mockHttpClientFactory);
  }

  @Test
  public void testAuthenticate()

Examples of org.sonatype.nexus.templates.repository.ManuallyConfiguredRepositoryTemplate.create()

        // For now, this is a "backdoor", using manual template when we have a CRepo object.
        ManuallyConfiguredRepositoryTemplate template =
            repositoryTemplateProvider.createManuallyTemplate(new CRepositoryCoreConfiguration(
                repositoryTemplateProvider.getApplicationConfiguration(), config, null));

        template.create();

        getNexusConfiguration().saveConfiguration();
      }
      catch (ConfigurationException e) {
        handleConfigurationException(e);

Examples of org.sonatype.nexus.templates.repository.RepositoryTemplate.create()

      template.getConfigurableRepository().setExposed(model.isExposed());

      template.getConfigurableRepository().setLocalStatus(LocalStatus.IN_SERVICE);

      // we create an empty group
      GroupRepository groupRepository = (GroupRepository) template.create();

      ArrayList<String> memberIds = new ArrayList<String>(model.getRepositories().size());

      for (RepositoryGroupMemberRepository member : (List<RepositoryGroupMemberRepository>) model
          .getRepositories()) {
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.