Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
gunlee01 committed Dec 20, 2016
1 parent e0a2068 commit 14083e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 13 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.scouter-project</groupId>
<artifactId>scouter-plugin-server-alert-line</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -119,6 +119,18 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@
*/
@RunWith(MockitoJUnitRunner.class)
public class LinePluginTest {
public final static String lineAccessToken = "Wd8jVkD5Fzh7CMl1CTmyOo9ILtWq1MoknQ7kbTMMjQmdU6+cDmfqkwwuE5mB5rLQcFeWCjvjJgnE/MmqT6D+gEsO68vKQh11YygUT7dQmh1JwmWG5mbRqk98Xo1+aBWHllG0AL/6xAp7YMtG9MDVPwdB04t89/1O/w1cDnyilFU=";
public static final String lineGroupId = "C0246cfa665d99ec6dde3f12bec77eb4a";

@Mock Configure conf;
@InjectMocks LinePlugin plugin = new LinePlugin();

@Test
public void alert() throws Exception {
when(conf.getValue("ext_plugin_line_access_token")).thenReturn("Wd8jVkD5Fzh7CMl1CTmyOo9ILtWq1MoknQ7kbTMMjQmdU6+cDmfqkwwuE5mB5rLQcFeWCjvjJgnE/MmqT6D+gEsO68vKQh11YygUT7dQmh1JwmWG5mbRqk98Xo1+aBWHllG0AL/6xAp7YMtG9MDVPwdB04t89/1O/w1cDnyilFU=");
when(conf.getValue("ext_plugin_line_group_id")).thenReturn("C0246cfa665d99ec6dde3f12bec77eb4a");
when(conf.getValue("ext_plugin_line_access_token")).thenReturn(lineAccessToken);
when(conf.getValue("ext_plugin_line_group_id")).thenReturn(lineGroupId);
when(conf.getBoolean(eq("ext_plugin_line_send_alert"), anyBoolean())).thenReturn(true);
//when(conf.getBoolean("ext_plugin_line_send_alert", false)).thenReturn(true);

AlertPack ap = genAlertPack();
plugin.alert(ap);
Expand Down

0 comments on commit 14083e8

Please sign in to comment.