mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
change BaseIT test class so that authentication with the "admin" user is not the default
This commit is contained in:
@@ -3,6 +3,8 @@ package com.commafeed.integration.rest;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.glassfish.jersey.client.JerseyClientBuilder;
|
||||
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,6 +19,11 @@ import jakarta.ws.rs.client.Entity;
|
||||
|
||||
class AdminIT extends BaseIT {
|
||||
|
||||
@Override
|
||||
protected JerseyClientBuilder configureClientBuilder(JerseyClientBuilder base) {
|
||||
return base.register(HttpAuthenticationFeature.basic("admin", "admin"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getApplicationSettings() {
|
||||
ApplicationSettings settings = getClient().target(getApiBaseUrl() + "admin/settings").request().get(ApplicationSettings.class);
|
||||
|
||||
@@ -13,6 +13,8 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.awaitility.Awaitility;
|
||||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.glassfish.jersey.client.ClientProperties;
|
||||
import org.glassfish.jersey.client.JerseyClientBuilder;
|
||||
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
|
||||
import org.glassfish.jersey.media.multipart.MultiPart;
|
||||
import org.glassfish.jersey.media.multipart.file.StreamDataBodyPart;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
@@ -34,6 +36,11 @@ import jakarta.ws.rs.core.Response;
|
||||
|
||||
class FeedIT extends BaseIT {
|
||||
|
||||
@Override
|
||||
protected JerseyClientBuilder configureClientBuilder(JerseyClientBuilder base) {
|
||||
return base.register(HttpAuthenticationFeature.basic("admin", "admin"));
|
||||
}
|
||||
|
||||
@Nested
|
||||
class Fetch {
|
||||
@Test
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.commafeed.integration.rest;
|
||||
|
||||
import org.glassfish.jersey.client.JerseyClientBuilder;
|
||||
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -18,6 +20,11 @@ class FeverIT extends BaseIT {
|
||||
private Long userId;
|
||||
private String apiKey;
|
||||
|
||||
@Override
|
||||
protected JerseyClientBuilder configureClientBuilder(JerseyClientBuilder base) {
|
||||
return base.register(HttpAuthenticationFeature.basic("admin", "admin"));
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void init() {
|
||||
// create api key
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test;
|
||||
import com.commafeed.frontend.model.ServerInfo;
|
||||
import com.commafeed.integration.BaseIT;
|
||||
|
||||
public class ServerIT extends BaseIT {
|
||||
class ServerIT extends BaseIT {
|
||||
|
||||
@Test
|
||||
void getServerInfos() {
|
||||
|
||||
Reference in New Issue
Block a user