[TEST] Use valid file extension for mapping tests
Original commit: elastic/x-pack-elasticsearch@080699aeb8
This commit is contained in:
parent
691bdfcf14
commit
89f98c60dc
|
@ -137,9 +137,7 @@ public class DnRoleMapper {
|
||||||
if (dnToRoles.isEmpty()) {
|
if (dnToRoles.isEmpty()) {
|
||||||
logger.warn("no mappings found in role mappings file [{}] for realm [{}/{}]", path.toAbsolutePath(), realmType, realmName);
|
logger.warn("no mappings found in role mappings file [{}] for realm [{}/{}]", path.toAbsolutePath(), realmType, realmName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return unmodifiableMap(dnToRoles);
|
return unmodifiableMap(dnToRoles);
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ElasticsearchException("could not read realm [" + realmType + "/" + realmName + "] role mappings file [" +
|
throw new ElasticsearchException("could not read realm [" + realmType + "/" + realmName + "] role mappings file [" +
|
||||||
path.toAbsolutePath() + "]", e);
|
path.toAbsolutePath() + "]", e);
|
||||||
|
|
|
@ -190,7 +190,8 @@ public class DnRoleMapperTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testParseFile_Empty() throws Exception {
|
public void testParseFile_Empty() throws Exception {
|
||||||
Path file = createTempFile();
|
Path file = createTempDir().resolve("foo.yaml");
|
||||||
|
Files.createFile(file);
|
||||||
CapturingLogger logger = new CapturingLogger(CapturingLogger.Level.INFO);
|
CapturingLogger logger = new CapturingLogger(CapturingLogger.Level.INFO);
|
||||||
Map<DN, Set<String>> mappings = DnRoleMapper.parseFile(file, logger, "_type", "_name");
|
Map<DN, Set<String>> mappings = DnRoleMapper.parseFile(file, logger, "_type", "_name");
|
||||||
assertThat(mappings, notNullValue());
|
assertThat(mappings, notNullValue());
|
||||||
|
|
Loading…
Reference in New Issue