Skip to content

Commit

Permalink
Merged in bugfix/shibui-2182 (pull request #561)
Browse files Browse the repository at this point in the history
SHIBUI-2182

Approved-by: Bill Smith
Approved-by: Jonathan Johnson
  • Loading branch information
chasegawa authored and Jonathan Johnson committed Nov 1, 2021
2 parents b1425af + f136f4f commit 2ef41dc
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,37 @@ class MetadataResolverControllerVersionEndpointsIntegrationTests extends Specifi
mrv2.body.name == 'resolverUPDATED'
}

def "SHIBUI-2182"() {
given:
def mr = new DynamicHttpMetadataResolver().with {
it.name = 'resolver2'
it.metadataRequestURLConstructionScheme = new RegexScheme().with {
it.match = 'This is the match field'
it.content = 'some content'
it
}
it
}
mr = repository.save(mr)
//Will create a second version for UPDATE revision
mr.name = 'resolverUPDATED'
mr.metadataRequestURLConstructionScheme.match = 'This is the match field too'
repository.save(mr)

when:
def allVersions = getAllMetadataResolverVersions(mr.resourceId, List)
def mrv1 = getMetadataResolverForVersion(mr.resourceId, allVersions.body[0].id, MetadataResolver)
def mrv2 = getMetadataResolverForVersion(mr.resourceId, allVersions.body[1].id, MetadataResolver)

then:
mrv1.statusCodeValue == 200
mrv1.body.name == 'resolver2'
mrv1.body.metadataRequestURLConstructionScheme.match == 'This is the match field'
mrv2.statusCodeValue == 200
mrv2.body.name == 'resolverUPDATED'
mrv2.body.metadataRequestURLConstructionScheme.match == 'This is the match field too'
}

def "SHIBUI-1386"() {
given:
MetadataResolver mr = new FileBackedHttpMetadataResolver(name: 'testme')
Expand Down Expand Up @@ -292,4 +323,4 @@ trait AttributeReleaseAndOverrides {
Map<String, Object> overrides(int filterIndex) {
(this.metadataFilters[filterIndex] as EntityAttributesFilter).relyingPartyOverrides
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,7 @@ public String toString() {
String type;

String content;
}

@Transient
String match;
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public MetadataResolver findSpecificVersionOfMetadataResolver(String resourceId,
return resolver;

}
}
}

0 comments on commit 2ef41dc

Please sign in to comment.