Skip to content

Commit

Permalink
NXP-14277: reduce direct references to DatabaseHelper and implementat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
Florent Guillaume authored and nuxeojenkins committed Apr 7, 2015
1 parent 7b8fdff commit 4af2ed9
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -34,6 +34,7 @@
import org.nuxeo.ecm.core.api.DocumentModelList;
import org.nuxeo.ecm.core.storage.sql.DatabaseHelper;
import org.nuxeo.ecm.core.storage.sql.DatabaseMySQL;
import org.nuxeo.ecm.core.test.CoreFeature;
import org.nuxeo.ecm.directory.Session;
import org.nuxeo.ecm.directory.api.DirectoryService;
import org.nuxeo.ecm.tokenauth.service.TokenAuthenticationService;
Expand All @@ -58,6 +59,9 @@ public class TestTokenAuthenticationService {
@Inject
protected DirectoryService directoryService;

@Inject
protected CoreFeature coreFeature;

@After
public void cleanDirectories() throws Exception {
Session tokenDirSession = directoryService.open("authTokens");
Expand Down Expand Up @@ -179,7 +183,7 @@ public void testGetTokenBindings() throws ClientException {
assertEquals(3, tokenAuthenticationService.getTokenBindings("joe").size());

// Bindings should be sorted by descendant creation date
if (!(DatabaseHelper.DATABASE instanceof DatabaseMySQL)) {
if (coreFeature.getStorageConfiguration().hasSubSecondResolution()) {
DocumentModel tokenBinding = tokenBindings.get(0);
String binding1Token = (String) tokenBinding.getPropertyValue("authtoken:token");
log.debug("binding1Token = " + binding1Token);
Expand Down

0 comments on commit 4af2ed9

Please sign in to comment.