public class UserIdTest extends Assert {
@Test
public void testGetUserId() throws Exception {
UserId owner = new UserId(UserId.Type.owner, "hello");
assertEquals("owner", owner.getUserId(new FakeGadgetToken().setOwnerId("owner")));
UserId viewer = new UserId(UserId.Type.viewer, "hello");
assertEquals("viewer", viewer.getUserId(new FakeGadgetToken().setViewerId("viewer")));
UserId me = new UserId(UserId.Type.me, "hello");
assertEquals("viewer", me.getUserId(new FakeGadgetToken().setViewerId("viewer")));
UserId user = new UserId(UserId.Type.userId, "hello");
assertEquals("hello", user.getUserId(new FakeGadgetToken()));
}