Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class I18nEntryController {
private I18nEntryService i18nEntryService;

/**
* Gets all i 18 n entries by app.
* Gets i 18 n entries by app.
*
* @return 获取国际化词条列表 i 18 n entries
*/
Expand All @@ -79,7 +79,7 @@ public class I18nEntryController {
content = @Content(mediaType = "application/json", schema = @Schema())),
@ApiResponse(responseCode = "400", description = "请求失败")
})
@SystemControllerLog(description = "获取国际化词条列表")
@SystemControllerLog(description = "通过app获取国际化词条列表")
@GetMapping("/i18n/entries")
public Result<I18nEntryListResult> getI18nEntriesByApp( @RequestParam(value = "host", required = false) Integer host,
@RequestParam(value = "host_type", required = false) String hostType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ void setUp() {
}

@Test
void testGetAllI18nEntries() {
void testGetI18nEntriesByApp() {
I18nEntryListResult mockData = new I18nEntryListResult();
when(i18nEntryService.findAllI18nEntry()).thenReturn(mockData);

Result<I18nEntryListResult> result = i18nEntryController.getAllI18nEntries();
when(i18nEntryService.findI18nEntryByApp(anyInt(), anyString())).thenReturn(mockData);
Integer host = 1;
String hostType = "app";
Result<I18nEntryListResult> result = i18nEntryController.getI18nEntriesByApp(host, hostType);
Assertions.assertEquals(mockData, result.getData());
}

Expand Down