Package org.sonar.wsclient.services

Examples of org.sonar.wsclient.services.ServerSetup


public class ServerSetupUnmarshaller implements Unmarshaller<ServerSetup> {
  @Override
  public ServerSetup toModel(String json) {
    WSUtils utils = WSUtils.getINSTANCE();
    Object map = utils.parse(json);
    return new ServerSetup()
      .setStatus(utils.getString(map, "status"))
      .setMessage(utils.getString(map, "msg"));
  }
View Full Code Here


public class ServerSetupUnmarshallerTest extends UnmarshallerTestCase {

  @Test
  public void testSuccessfulSetup() {
    ServerSetup setup = new ServerSetupUnmarshaller().toModel(loadFile("/server_setup/ok.json"));
    assertThat(setup.getStatus(), is("ok"));
    assertThat(setup.getMessage(), nullValue());
    assertThat(setup.isSuccessful(), is(true));
  }
View Full Code Here

    assertThat(setup.isSuccessful(), is(true));
  }

  @Test
  public void testFailedSetup() {
    ServerSetup setup = new ServerSetupUnmarshaller().toModel(loadFile("/server_setup/ko.json"));
    assertThat(setup.getStatus(), is("ko"));
    assertThat(setup.getMessage(), is("error"));
    assertThat(setup.isSuccessful(), is(false));
  }
View Full Code Here

TOP

Related Classes of org.sonar.wsclient.services.ServerSetup

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.