mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 09:40:58 +00:00
[manager] add app service impl unit test (#393)
This commit is contained in:
@@ -1,37 +1,52 @@
|
||||
package com.usthe.manager.service;
|
||||
|
||||
import com.usthe.manager.controller.NoticeConfigController;
|
||||
import com.usthe.manager.service.impl.AppServiceImpl;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
* Test case for {@link AppService}
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class AppServiceTest {
|
||||
|
||||
@InjectMocks
|
||||
private AppServiceImpl appService;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
void setUp() throws Exception {
|
||||
appService.run();
|
||||
}
|
||||
|
||||
@Test
|
||||
void getAppParamDefines() {
|
||||
assertDoesNotThrow(() -> appService.getAppParamDefines("jvm"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getAppDefine() {
|
||||
assertDoesNotThrow(() -> appService.getAppDefine("jvm"));
|
||||
assertThrows(IllegalArgumentException.class, () -> appService.getAppDefine("unknown"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getAppDefineMetricNames() {
|
||||
assertDoesNotThrow(() -> appService.getAppDefineMetricNames("jvm"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getI18nResources() {
|
||||
assertDoesNotThrow(() -> appService.getI18nResources("en-US"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getAllAppHierarchy() {
|
||||
assertDoesNotThrow(() -> appService.getAllAppHierarchy("en-US"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user