mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
expose plugin dependencies
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
@@ -14,7 +14,6 @@ import sonia.scm.plugin.PluginState;
|
||||
import java.net.URI;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.in;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@@ -89,6 +88,15 @@ class PluginDtoMapperTest {
|
||||
assertThat(dto.getCategory()).isEqualTo("Miscellaneous");
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldAppendDependencies() {
|
||||
Plugin plugin = createPlugin(PluginState.AVAILABLE);
|
||||
when(plugin.getDescriptor().getDependencies()).thenReturn(ImmutableSet.of("one", "two"));
|
||||
|
||||
PluginDto dto = mapper.map(plugin);
|
||||
assertThat(dto.getDependencies()).containsOnly("one", "two");
|
||||
}
|
||||
|
||||
private Plugin createPlugin(PluginState state) {
|
||||
return createPlugin(createPluginInformation(), state);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user