mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-19 14:02:13 +01:00
fix tests
This commit is contained in:
@@ -133,6 +133,11 @@ class AvailablePluginResourceTest {
|
||||
@Nested
|
||||
class WithoutAuthorization {
|
||||
|
||||
@BeforeEach
|
||||
void unbindSubject() {
|
||||
ThreadContext.unbindSubject();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldNotGetAvailablePluginsIfMissingPermission() throws URISyntaxException {
|
||||
MockHttpRequest request = MockHttpRequest.get("/v2/plugins/available");
|
||||
@@ -153,6 +158,7 @@ class AvailablePluginResourceTest {
|
||||
|
||||
@Test
|
||||
void shouldNotInstallPluginIfMissingPermission() throws URISyntaxException {
|
||||
ThreadContext.unbindSubject();
|
||||
MockHttpRequest request = MockHttpRequest.post("/v2/plugins/available/pluginName/2.0.0/install");
|
||||
request.accept(VndMediaType.PLUGIN);
|
||||
MockHttpResponse response = new MockHttpResponse();
|
||||
|
||||
@@ -140,7 +140,7 @@ class InstalledPluginResourceTest {
|
||||
@Test
|
||||
void shouldNotGetInstalledPluginIfMissingPermission() throws URISyntaxException {
|
||||
MockHttpRequest request = MockHttpRequest.get("/v2/plugins/installed/pluginName");
|
||||
// request.accept(VndMediaType.PLUGIN);
|
||||
request.accept(VndMediaType.PLUGIN);
|
||||
MockHttpResponse response = new MockHttpResponse();
|
||||
|
||||
assertThrows(UnhandledException.class, () -> dispatcher.invoke(request, response));
|
||||
|
||||
Reference in New Issue
Block a user