Commit 6ced0452 authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

more tests

parent 0c47cee8
......@@ -80,15 +80,21 @@ public class CTFApplication extends Application<ApplicationConfiguration>
user.setEmail("asdfht");
user.setPassword("asdf");
user.setAdmin(false);
user.setTeam(team);
Repository<Team> teamRepository = injector.getInstance(Key.get(new TypeLiteral<Repository<Team>>(){}));
Repository<User> userRepository = injector.getInstance(Key.get(new TypeLiteral<Repository<User>>(){}));
teamRepository.add(team);
List<Team> all1 = teamRepository.getAll();
List<Team> teams = teamRepository.getAll();
userRepository.add(user);
List<User> all = userRepository.getAll();
List<User> users = userRepository.getAll();
Team team1 = teams.get(0);
team1.setDescription("new descr");
teamRepository.update(team1);
List<User> users2 = userRepository.getAll();
registerAdmins(applicationConfiguration);
registerResources(environment);
......
package com.telephoners.krakyournet.ctf.beans;
import org.ektorp.docref.DocumentReferences;
import org.ektorp.support.CouchDbDocument;
//todo: use CouchDbDocument
......@@ -11,6 +12,10 @@ public class User extends CouchDbDocument
private String email;
private boolean admin = false;
@DocumentReferences //todo: important! doesnot work
private Team team;
public String getName()
{
return name;
......@@ -50,4 +55,14 @@ public class User extends CouchDbDocument
{
this.admin = admin;
}
public Team getTeam()
{
return team;
}
public void setTeam(Team team)
{
this.team = team;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment