296a57ba968152e5627f1cd75cd8a8c401de6de8
[JavaForFun] /
1 package de.example.plugins.custom.java;
2
3 import static org.hamcrest.CoreMatchers.is;
4 import static org.junit.Assert.assertThat;
5
6 import org.junit.Test;
7 import org.sonar.api.Plugin;
8 import org.sonar.api.SonarQubeVersion;
9
10 public class CustomPluginTest {
11
12         @Test
13         public void whenCreatingCustomJavaPluginThenRetrieveRightNumberOfExtensions() {
14                 CustomPlugin javaPlugin = new CustomPlugin();
15                 Plugin.Context context = new Plugin.Context(SonarQubeVersion.V5_6);
16                 
17                 javaPlugin.define(context);
18
19                 assertThat(context.getExtensions().size(), is(3));
20         }
21
22 }