fix tests

This commit is contained in:
Eduard Heimbuch
2019-08-01 09:14:48 +02:00
parent 35c5a69511
commit 853bf133ca
2 changed files with 7 additions and 1 deletions

View File

@@ -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();

View File

@@ -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));