Skip to content

Commit

Permalink
fixed a bug with the admin user having no joined-on date set
Browse files Browse the repository at this point in the history
  • Loading branch information
EricWittmann committed Nov 6, 2015
1 parent dfb4743 commit a291e68
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Expand Up @@ -64,8 +64,8 @@ public void testUploadLimit() throws Throwable {
Assert.assertNotNull(counterValue3);
Assert.assertEquals(counterValue, counterValue3);

// Now wait for 2s and make sure the cache entry expired
Thread.sleep(2000);
// Now wait for 3s and make sure the cache entry expired
Thread.sleep(3000);
response = send(request);
echo = response.entity(EchoResponse.class);
Assert.assertNotNull(echo);
Expand Down
Expand Up @@ -97,7 +97,6 @@ public CurrentUserBean getInfo() {
user.setJoinedOn(new Date());
storage.beginTx();
try {
user.setJoinedOn(new Date());
storage.createUser(user);
storage.commitTx();
} catch (StorageException e1) {
Expand Down
Expand Up @@ -19,6 +19,8 @@
import io.apiman.manager.api.core.IStorage;
import io.apiman.manager.api.core.exceptions.StorageException;

import java.util.Date;

/**
* Default seeder used by tests.
*
Expand All @@ -37,6 +39,7 @@ public void seed(IStorage storage) throws StorageException {
userBean.setUsername(userInfo[0]);
userBean.setFullName(userInfo[2]);
userBean.setEmail(userInfo[3]);
userBean.setJoinedOn(new Date());
if ("true".equals(System.getProperty("apiman.test.admin-user-only", "false")) && !userBean.getUsername().equals("admin")) {
continue;
}
Expand Down

0 comments on commit a291e68

Please sign in to comment.