From b0cee20307e75b1b00c3ef2c14135774606a7c05 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Fri, 29 Nov 2024 21:38:03 +0200 Subject: Add more tests --- .../test/java/org/pf4j/CompoundPluginRepositoryTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pf4j/src/test/java/org/pf4j/CompoundPluginRepositoryTest.java b/pf4j/src/test/java/org/pf4j/CompoundPluginRepositoryTest.java index 72a5dba..7a3a82f 100644 --- a/pf4j/src/test/java/org/pf4j/CompoundPluginRepositoryTest.java +++ b/pf4j/src/test/java/org/pf4j/CompoundPluginRepositoryTest.java @@ -86,4 +86,17 @@ class CompoundPluginRepositoryTest { assertFalse(compoundRepository.deletePluginPath(path)); } + @Test + void deletePluginPathFromMultipleRepositories() { + CompoundPluginRepository compoundRepository = new CompoundPluginRepository(); + PluginRepository mockRepository1 = mock(PluginRepository.class); + PluginRepository mockRepository2 = mock(PluginRepository.class); + Path path = mock(Path.class); + when(mockRepository1.deletePluginPath(path)).thenReturn(false); + when(mockRepository2.deletePluginPath(path)).thenReturn(true); + compoundRepository.add(mockRepository1); + compoundRepository.add(mockRepository2); + assertTrue(compoundRepository.deletePluginPath(path)); + } + } -- cgit v1.2.3