Browse Source

Removed localAuthBypassEnabled override in unit tests.

Hopefully this will allow us to proactively catch any missing API keys in the future.
trade-portal-updates
CalDescent 3 years ago
parent
commit
ff6ec83b1c
  1. 7
      src/test/java/org/qortal/test/api/AdminApiTests.java
  2. 3
      src/test/resources/test-settings-v2.json

7
src/test/java/org/qortal/test/api/AdminApiTests.java

@ -2,10 +2,12 @@ package org.qortal.test.api;
import static org.junit.Assert.*;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.Before;
import org.junit.Test;
import org.qortal.api.resource.AdminResource;
import org.qortal.repository.DataException;
import org.qortal.settings.Settings;
import org.qortal.test.common.ApiCommon;
import org.qortal.test.common.Common;
@ -29,7 +31,10 @@ public class AdminApiTests extends ApiCommon {
}
@Test
public void testSummary() {
public void testSummary() throws IllegalAccessException {
// Set localAuthBypassEnabled to true, since we don't need to test authentication here
FieldUtils.writeField(Settings.getInstance(), "localAuthBypassEnabled", true, true);
assertNotNull(this.adminResource.summary("testApiKey"));
}

3
src/test/resources/test-settings-v2.json

@ -15,6 +15,5 @@
"tempDataPath": "data-test/_temp",
"listsPath": "lists-test",
"storagePolicy": "FOLLOWED_OR_VIEWED",
"maxStorageCapacity": 104857600,
"localAuthBypassEnabled": true
"maxStorageCapacity": 104857600
}

Loading…
Cancel
Save