Skip to content

Commit

Permalink
GEODE-8496: fix rest management test after dependency bump (apache#5547)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmeiliao authored Sep 23, 2020
1 parent a355764 commit c49389e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;

import org.apache.geode.cache.query.QueryService;
Expand Down Expand Up @@ -182,11 +181,12 @@ public void getIndex_fails_when_index_name_and_region_name_are_missing() {
.hasMessageContaining("Unable to construct the URI ");
}

@Ignore("revisit in a separate PR")
@Test
public void getIndex_fails_when_region_name_is_missing_from_filter() {
indexConfig.setName("index1");
assertThatThrownBy(() -> cms.get(indexConfig))
.hasMessageContaining("Error while extracting response for type");
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("Unable to construct the URI with the current configuration");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ public String getId() {
@Override
public Links getLinks() {
String regionName = getRegionName();
// /indexes/indexName is not implemented in controller anymore. region name is required for the
// self link
if (StringUtils.isBlank(regionName)) {
return new Links(getId(), INDEXES);
return new Links(null, INDEXES);
}
Links links = new Links(getId(), Region.REGION_CONFIG_ENDPOINT + "/" + regionName + INDEXES);
links.addLink("region", Region.REGION_CONFIG_ENDPOINT + "/" + regionName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,20 @@ public void getRegionName() {

@Test
public void getEndPoint() {
assertSoftly(softly -> {
assertThat(index.getLinks().getList()).isEqualTo("/indexes");
assertThat(index.getLinks().getList()).isEqualTo("/indexes");

index.setName("testSelf");
softly.assertThat(index.getLinks().getSelf()).as("only name defined - self")
.isEqualTo("/indexes/testSelf");
softly.assertThat(index.getLinks().getList()).as("only name defined - list")
.isEqualTo("/indexes");
index.setName("testSelf");
assertThat(index.getLinks().getSelf()).as("only name defined - self")
.isNull();
assertThat(index.getLinks().getList()).as("only name defined - list")
.isEqualTo("/indexes");

index.setRegionPath(SEPARATOR + "regionPath");
softly.assertThat(index.getLinks().getSelf()).as("region and name defined - self")
.isEqualTo("/regions/regionPath/indexes/testSelf");
softly.assertThat(index.getLinks().getList()).as("region and name defined - list")
.isEqualTo("/regions/regionPath/indexes");
index.setRegionPath(SEPARATOR + "regionPath");
assertThat(index.getLinks().getSelf()).as("region and name defined - self")
.isEqualTo("/regions/regionPath/indexes/testSelf");
assertThat(index.getLinks().getList()).as("region and name defined - list")
.isEqualTo("/regions/regionPath/indexes");

});
}

@Test
Expand Down

0 comments on commit c49389e

Please sign in to comment.