Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyk committed Jul 11, 2018
1 parent f62c74c commit 0ebbb50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/zerocracy/pmo/People.java
Expand Up @@ -850,18 +850,18 @@ public Date appliedTime(final String uid) throws IOException {

/**
* Skills of a person.
* @param uid Person's login
* @param user Person's login
* @return Iterable with skills
* @throws IOException If fails
*/
public Iterable<String> skills(final String uid) throws IOException {
public Iterable<String> skills(final String user) throws IOException {
try (final Item item = this.item()) {
return new Mapped<>(
xml -> xml.node().getTextContent(),
new Xocument(item.path()).nodes(
String.format(
"/people/person[@id = '%s']/skills/skill",
uid
user
)
)
);
Expand Down
18 changes: 16 additions & 2 deletions src/test/java/com/zerocracy/pmo/PeopleTest.java
Expand Up @@ -558,8 +558,9 @@ public void setsLinks() throws Exception {

@Test
public void setsSkills() throws IOException {
final People people =
new People(new FkFarm(new FkProject())).bootstrap();
final People people = new People(
new FkFarm(new FkProject())
).bootstrap();
final String uid = "user";
people.invite(uid, "0crat");
final Iterable<String> skills = new IterableOf<>("c", "cobol");
Expand All @@ -570,6 +571,19 @@ public void setsSkills() throws IOException {
);
}

@Test
public void getsEmptySkillList() throws IOException {
final People people = new People(
new FkFarm(new FkProject())
).bootstrap();
final String uid = "user";
people.invite(uid, "0crat");
MatcherAssert.assertThat(
people.skills(uid),
Matchers.emptyIterable()
);
}

private void failsWallet(final String bank, final String wallet)
throws IOException {
final FkFarm farm = new FkFarm(new FkProject());
Expand Down

0 comments on commit 0ebbb50

Please sign in to comment.