Package org.sonar.wsclient.services

Examples of org.sonar.wsclient.services.Property


import static org.junit.Assert.assertThat;

public class PropertyUnmarshallerTest extends UnmarshallerTestCase {
  @Test
  public void toModel() {
    Property property = new PropertyUnmarshaller().toModel("[]");
    assertThat(property, nullValue());

    property = new PropertyUnmarshaller().toModel(loadFile("/properties/single.json"));
    assertThat(property.getKey(), is("myprop"));
    assertThat(property.getValue(), is("myvalue"));
  }
View Full Code Here


public class PropertyUnmarshaller extends AbstractUnmarshaller<Property> {

  @Override
  protected Property parse(Object json) {
    WSUtils utils = WSUtils.getINSTANCE();
    return new Property()
        .setKey(utils.getString(json, "key"))
        .setValue(utils.getString(json, "value"));
  }
View Full Code Here

TOP

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

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.