@Test public void shouldUpdateResourceSetToken() throws Exception { // Given ResourceSetDescription resourceSetDescription = new ResourceSetDescription( "RESOURCE_SET_ID", "CLIENT_ID", "RESOURCE_OWNER_ID", Collections.<String, Object>emptyMap()); resourceSetDescription.setRealm("REALM"); given( dataStore.query( QueryFilter.and( QueryFilter.equalTo(ResourceSetTokenField.RESOURCE_SET_ID, "RESOURCE_SET_ID"), QueryFilter.equalTo(ResourceSetTokenField.REALM, "REALM")))) .willReturn(Collections.singleton(resourceSetDescription)); // When store.update(resourceSetDescription); // Then verify(dataStore).update(resourceSetDescription); }