Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tanya732 committed Jan 24, 2025
1 parent 7b85db0 commit 7eb5e98
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/auth0/client/mgmt/ConnectionsEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public Request<ScimConfigurationResponse> createScimConfiguration(String connect
* @param connectionId the connection id.
* @return a Request to execute.
*/
public Request<Mapping> getDefaultScimConfiguration(String connectionId){
public Request<DefaultScimMappingResponse> getDefaultScimConfiguration(String connectionId){
Asserts.assertNotNull(connectionId, "connection id");

String url = baseUrl
Expand All @@ -275,7 +275,7 @@ public Request<Mapping> getDefaultScimConfiguration(String connectionId){
.addPathSegment("default-mapping")
.build()
.toString();
return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference<Mapping>() {
return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference<DefaultScimMappingResponse>() {
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.auth0.json.mgmt.connections;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DefaultScimMappingResponse {
@JsonProperty("mapping")
private List<Mapping> mapping;

/**
* Creates a new instance.
*/
@JsonCreator
public DefaultScimMappingResponse() {
}

/**
* Creates a new instance with the given mapping.
* @param mapping the mapping attribute.
*/
@JsonCreator
public DefaultScimMappingResponse(@JsonProperty("mapping") List<Mapping> mapping) {
this.mapping = mapping;
}

/**
* Getter for the mapping attribute.
* @return the mapping attribute.
*/
public List<Mapping> getMapping() {
return mapping;
}

/**
* Setter for the mapping attribute.
* @param mapping the mapping attribute to set.
*/
public void setMapping(List<Mapping> mapping) {
this.mapping = mapping;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,11 @@ public void shouldThrowOnGetDefaultScimConfigurationWithNullId() {

@Test
public void shouldGetDefaultScimConfiguration() throws Exception {
Request<Mapping> request = api.connections().getDefaultScimConfiguration("1");
Request<DefaultScimMappingResponse> request = api.connections().getDefaultScimConfiguration("1");
assertThat(request, is(notNullValue()));

server.jsonResponse(MGMT_CONNECTION_DEFAULT_SCIM_CONFIGURATION, 200);
Mapping response = request.execute().getBody();
DefaultScimMappingResponse response = request.execute().getBody();
RecordedRequest recordedRequest = server.takeRequest();

assertThat(recordedRequest, hasMethodAndPath(HttpMethod.GET, "/api/v2/connections/1/scim-configuration/default-mapping"));
Expand Down

0 comments on commit 7eb5e98

Please sign in to comment.