aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PluginUnmarshallerTest.java
blob: 6b709a3a5945eb8ed76a11c6e7e80a27a74d76eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package org.sonar.wsclient.unmarshallers;

import org.junit.Test;
import org.sonar.wsclient.services.Plugin;

import java.util.List;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

public class PluginUnmarshallerTest {

  @Test
  public void toModel() throws Exception {
    List<Plugin> plugins = new PluginUnmarshaller().toModels(WSTestUtils.loadFile("/plugins/plugins.json"));
    Plugin plugin = plugins.get(0);
    assertThat(plugin.getKey(), is("foo"));
    assertThat(plugin.getName(), is("Foo"));
    assertThat(plugin.getVersion(), is("1.0"));
  }

}