Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,9 @@ public void addBehavior(Object target, Context context) {
.getUsername()
.concat(HttpSecurityConstants.BASIC_CREDENTIAL_SEPARATOR)
.concat(httpContext.getSecurity().getPassword());
String authEncode = encodeAuthorization(authString);
String authEncode = Base64.getEncoder().encodeToString(authString.getBytes());
request.setHeader(
HttpSecurityConstants.HEADER_AUTHORIZATION,
HttpSecurityConstants.AUTH_SCHEME_BASIC_PREFIX.concat(authEncode));
}

private String encodeAuthorization(String authorization) {
return Base64.getEncoder().encodeToString(authorization.getBytes());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,22 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.sitmun.proxy.middleware.test.fixtures.AuthorizationProxyFixtures.*;

import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Objects;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.sitmun.proxy.middleware.service.RequestExecutorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.json.JacksonTester;
import org.springframework.http.ResponseEntity;

@SpringBootTest
@AutoConfigureTestDatabase
@TestInstance(Lifecycle.PER_CLASS)
@DisplayName("Relational requests tests")
class ExecutionRequestExecutorServiceTest {

@Autowired private RequestExecutorService requestExecutorService;

@BeforeAll
void setup() {
ObjectMapper objectMapper = new ObjectMapper();
JacksonTester.initFields(this, objectMapper);
}

/** Public user access to a relational service. */
@Test
@DisplayName("Request to a JDBC service")
Expand Down
Loading