Package org.sonar.server.ws

Examples of org.sonar.server.ws.WsTester$Result


    issueCreationDate = DateUtils.parseDateTime("2014-01-22T19:10:03+0100");
    when(i18n.formatDateTime(any(Locale.class), eq(issueCreationDate))).thenReturn("Jan 22, 2014 10:03 AM");

    when(i18n.message(any(Locale.class), eq("created"), eq((String) null))).thenReturn("Created");

    tester = new WsTester(new IssuesWs(
      new IssueShowAction(dbClient, issueService, issueChangelogService, commentService,
        new IssueActionsWriter(issueService, actionService), actionPlanService, userFinder, debtModel, ruleService, i18n, durations),
      new SearchAction(mock(DbClient.class), mock(IssueChangeDao.class), mock(IssueService.class), mock(IssueActionsWriter.class), mock(IssueQueryService.class),
        mock(RuleService.class),
        mock(ActionPlanService.class), mock(UserFinder.class), mock(I18n.class), mock(Durations.class), mock(Languages.class))));
View Full Code Here


  @Before
  public void setUp() throws Exception {
    when(dbClient.componentDao()).thenReturn(componentDao);
    when(dbClient.openSession(false)).thenReturn(session);
    tester = new WsTester(new SourcesWs(mock(ShowAction.class), new RawAction(dbClient, sourceService), mock(ScmAction.class)));
  }
View Full Code Here

  WebService.Controller controller;

  @Before
  public void setUp() throws Exception {
    WsTester tester = new WsTester(new TimeMachineWs());
    controller = tester.controller("api/timemachine");
  }
View Full Code Here

  WsTester tester;

  @Before
  public void setUp() throws Exception {
    tester = new WsTester(new SourcesWs(new ShowAction(sourceService), mock(RawAction.class), new ScmAction(sourceService, mock(ScmWriter.class))));
  }
View Full Code Here

  WsTester tester;

  @Before
  public void setUp() throws Exception {
    tester = new WsTester(new PermissionsWs());
  }
View Full Code Here

  WsTester tester;

  @Before
  public void setUp() throws Exception {
    tester = new WsTester(new UpdateCenterWs());
  }
View Full Code Here

    when(system.isOsWindows()).thenReturn(false);

    RestartHandler restartHandler = new RestartHandler(settings, platform, system);
    SystemWs ws = new SystemWs(restartHandler);

    WsTester tester = new WsTester(ws);
    tester.newPostRequest("api/system", "restart").execute();

    verify(platform).restart();
  }
View Full Code Here

    Platform platform = mock(Platform.class);
    Settings settings = new Settings();
    RestartHandler restartHandler = new RestartHandler(settings, platform, system);
    SystemWs ws = new SystemWs(restartHandler);

    WsTester tester = new WsTester(ws);
    try {
      tester.newPostRequest("api/system", "restart").execute();
      fail();
    } catch (ForbiddenException e) {
      verifyZeroInteractions(platform);
    }
  }
View Full Code Here

    when(system.isJavaAtLeast17()).thenReturn(false);

    RestartHandler restartHandler = new RestartHandler(settings, platform, system);
    SystemWs ws = new SystemWs(restartHandler);

    WsTester tester = new WsTester(ws);
    try {
      tester.newPostRequest("api/system", "restart").execute();
      fail();
    } catch (ForbiddenException e) {
      verifyZeroInteractions(platform);
    }
  }
View Full Code Here

    Date now = new Date();
    Date aBitLater = new Date(now.getTime() + 1000);
    when(server.getStartedAt()).thenReturn(now);

    Result result = new WsTester(new L10nWs(i18n, server)).newGetRequest("api/l10n", "index").setParam("ts", DateUtils.formatDateTime(aBitLater)).execute();
    verifyZeroInteractions(i18n);
    verify(server).getStartedAt();

    result.assertNotModified();
  }
View Full Code Here

TOP

Related Classes of org.sonar.server.ws.WsTester$Result

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.