From b95db687e41d1785c6d671eee566e324e24028a1 Mon Sep 17 00:00:00 2001 From: mabofu Date: Wed, 27 Aug 2025 19:12:24 +0800 Subject: [PATCH] Fixed FileSystem coverage 1.fixed code coverage: FileSystem Signed-off-by: Ma, Wenhao --- .../dfsbroker/filesystem/FileSystemTest.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 dsms-engine-application/src/test/java/com/dsms/dfsbroker/filesystem/FileSystemTest.java diff --git a/dsms-engine-application/src/test/java/com/dsms/dfsbroker/filesystem/FileSystemTest.java b/dsms-engine-application/src/test/java/com/dsms/dfsbroker/filesystem/FileSystemTest.java new file mode 100644 index 00000000..1b7d099e --- /dev/null +++ b/dsms-engine-application/src/test/java/com/dsms/dfsbroker/filesystem/FileSystemTest.java @@ -0,0 +1,39 @@ +package com.dsms.dfsbroker.filesystem; + +import com.dsms.dfsbroker.filesystem.model.remote.FsStatusResponse; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +@ExtendWith(MockitoExtension.class) +public class FileSystemTest { + private static final String FS_NAME = "fs-test"; + +// private FsStatusResponse fsStatusResponse; + + @BeforeEach + void setUp() { + FsStatusResponse fsStatusResponse = new FsStatusResponse(); + + List clients = new ArrayList<>(); + FsStatusResponse.ClientsDTO client = new FsStatusResponse.ClientsDTO(); + client.setFs(FS_NAME); + clients.add(client); + fsStatusResponse.setClients(clients); + } + @Test + void testFsStatusResponse() { + FsStatusResponse emptyResponse = new FsStatusResponse(); + emptyResponse.setClients(new ArrayList<>()); + + FileSystem result = FileSystem.fsStatusResponseParseFileSystem(emptyResponse); + + assertNull(result); + } +} -- Gitee