diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/client/ClientIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/client/ClientIT.groovy index 36747f118b..21b2a0452b 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/client/ClientIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/client/ClientIT.groovy @@ -39,8 +39,8 @@ import org.testng.annotations.BeforeClass import org.testng.annotations.BeforeTest import static com.stormpath.sdk.application.Applications.newCreateRequestFor -import static org.testng.AssertJUnit.assertEquals -import static org.testng.AssertJUnit.assertTrue +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertTrue abstract class ClientIT { diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/application/ApplicationIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/application/ApplicationIT.groovy index 05696c076c..edc00d0b94 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/application/ApplicationIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/application/ApplicationIT.groovy @@ -351,11 +351,13 @@ class ApplicationIT extends ClientIT { def dirName = uniquify("Java SDK Filter IT Dir") def dirName2 = uniquify("Java SDK IT Dir II") - app1 = tenant.createApplication(Applications.newCreateRequestFor(app1).createDirectoryNamed(dirName).build()) - app2 = tenant.createApplication(Applications.newCreateRequestFor(app2).createDirectoryNamed(dirName2).build()) + app1 = tenant.createApplication(newCreateRequestFor(app1).createDirectoryNamed(dirName).build()) + app2 = tenant.createApplication(newCreateRequestFor(app2).createDirectoryNamed(dirName2).build()) deleteOnTeardown(app1) deleteOnTeardown(app2) + deleteOnTeardown(client.getResource(app1.getDefaultAccountStore().href, Directory)) + deleteOnTeardown(client.getResource(app2.getDefaultAccountStore().href, Directory)) //verify that the filter search works with a combination of criteria def foundApps2 = tenant.getApplications(Applications.where(Applications.filter('Java SDK Filter IT App')).and(Applications.description().endsWithIgnoreCase('02'))) diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/GoogleAuthenticatorChallengeIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/GoogleAuthenticatorChallengeIT.groovy index 0fe3be84f0..3e8765f9da 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/GoogleAuthenticatorChallengeIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/GoogleAuthenticatorChallengeIT.groovy @@ -33,12 +33,14 @@ import org.joda.time.DateTimeZone import org.testng.annotations.Test import static com.stormpath.sdk.impl.challenge.TOTPService.getTotpPassword -import static org.testng.AssertJUnit.* +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertTrue +import static org.testng.Assert.assertNotNull /** * @since 1.1.0 */ -class GoogleAuthenticatorChallengeIT extends AbstractMultiFactorIT{ +class GoogleAuthenticatorChallengeIT extends AbstractMultiFactorIT { @Test void testSuccessfulGoogleAuthenticatorChallenge() { diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/SmsChallengeIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/SmsChallengeIT.groovy index 7670ad329e..9c1c792d7c 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/SmsChallengeIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/SmsChallengeIT.groovy @@ -26,13 +26,13 @@ import com.stormpath.sdk.phone.Phone import com.stormpath.sdk.resource.ResourceException import org.testng.annotations.Test -import static org.testng.AssertJUnit.assertEquals -import static org.testng.AssertJUnit.assertTrue +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertTrue /** * @since 1.1.0 */ -class SmsChallengeIT extends AbstractMultiFactorIT{ +class SmsChallengeIT extends AbstractMultiFactorIT { @Test void testFailedChallenge() { diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/SmsChallengeManualIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/SmsChallengeManualIT.groovy index 541cb79edd..61498345b8 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/SmsChallengeManualIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/challenge/SmsChallengeManualIT.groovy @@ -26,12 +26,14 @@ import com.stormpath.sdk.factor.sms.SmsFactor import com.stormpath.sdk.phone.Phone import org.testng.annotations.Test -import static org.testng.AssertJUnit.* +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertNotNull +import static org.testng.Assert.assertTrue /** * @since 1.1.0 */ -class SmsChallengeManualIT extends ClientIT{ +class SmsChallengeManualIT extends ClientIT { // This test and the next one (testSuccessfulChallengeVerifyChallenge) require an actual phone to complete // Therefore they are disabled and meant to be run manually diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/factor/GoogleAuthenticatorFactorIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/factor/GoogleAuthenticatorFactorIT.groovy index f9293fa849..6488b247f4 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/factor/GoogleAuthenticatorFactorIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/factor/GoogleAuthenticatorFactorIT.groovy @@ -28,7 +28,10 @@ import com.stormpath.sdk.impl.multifactor.AbstractMultiFactorIT import com.stormpath.sdk.resource.ResourceException import org.testng.annotations.Test -import static org.testng.AssertJUnit.* +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertFalse +import static org.testng.Assert.assertNotNull +import static org.testng.Assert.assertTrue /** * @since 1.1.0 @@ -50,26 +53,26 @@ class GoogleAuthenticatorFactorIT extends AbstractMultiFactorIT{ createSmsFactor(account, VALID_PHONE_NUMBER) def factors = account.getFactors(Factors.criteria().limitTo(50).offsetBy(0).orderByCreatedAt()); - assertEquals(factors.iterator().next().account.materialized, false) + assertFalse(factors.iterator().next().account.materialized) - factors = account.getFactors(Factors.SMS.criteria().withPhone().withAccount().limitTo(50).offsetBy(0).orderByCreatedAt()); - assertEquals(factors.iterator().next().account.materialized, true) - assertEquals(factors.iterator().next().phone.materialized, true) - assertEquals(factors.getProperty("items").size, 1); + factors = account.getFactors(Factors.SMS.criteria().withPhone().withAccount().limitTo(50).offsetBy(0).orderByCreatedAt()) + assertTrue(factors.iterator().next().account.materialized) + assertTrue(factors.iterator().next().phone.materialized) + assertEquals(factors.getProperty("items").size, 1) List factorsAsList = factors.asList() - for(Factor currentFactor : factorsAsList){ - if(currentFactor instanceof SmsFactor){ - assertEquals(currentFactor.phone.number,VALID_PHONE_NUMBER) + for (Factor currentFactor : factorsAsList) { + if (currentFactor instanceof SmsFactor) { + assertEquals(currentFactor.phone.number, VALID_PHONE_NUMBER) } } factors = account.getFactors(Factors.SMS.criteria().withPhone().limitTo(50).offsetBy(0).orderByCreatedAt()); - assertEquals(factors.getProperty("items").size,1) + assertEquals(factors.getProperty("items").size, 1) assertEquals(factors.getProperty("items").get(0).phone.number, VALID_PHONE_NUMBER) factors = account.getFactors(Factors.GOOGLE_AUTHENTICATOR.criteria().limitTo(50).offsetBy(0).orderByCreatedAt()); - assertEquals(factors.getProperty("items").size,1) + assertEquals(factors.getProperty("items").size, 1) assertNotNull(factors.getProperty("items").get(0).secret) } diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/factor/SmsFactorIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/factor/SmsFactorIT.groovy index 05436c795f..766abd5d65 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/factor/SmsFactorIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/factor/SmsFactorIT.groovy @@ -21,7 +21,11 @@ import com.stormpath.sdk.account.Accounts import com.stormpath.sdk.challenge.Challenge import com.stormpath.sdk.challenge.sms.SmsChallenge import com.stormpath.sdk.directory.Directory -import com.stormpath.sdk.factor.* +import com.stormpath.sdk.factor.Factor +import com.stormpath.sdk.factor.FactorOptions +import com.stormpath.sdk.factor.FactorStatus +import com.stormpath.sdk.factor.FactorVerificationStatus +import com.stormpath.sdk.factor.Factors import com.stormpath.sdk.factor.sms.SmsFactor import com.stormpath.sdk.factor.sms.SmsFactorOptions import com.stormpath.sdk.impl.multifactor.AbstractMultiFactorIT @@ -30,8 +34,12 @@ import com.stormpath.sdk.phone.Phone import com.stormpath.sdk.phone.PhoneStatus import com.stormpath.sdk.resource.ResourceException import org.testng.annotations.Test + import java.lang.reflect.Field -import static org.testng.AssertJUnit.* + +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertNotNull +import static org.testng.Assert.assertTrue /** * @since 1.1.0 diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/multifactor/AbstractMultiFactorIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/multifactor/AbstractMultiFactorIT.groovy index c88cabe8d3..426cd2dc15 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/multifactor/AbstractMultiFactorIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/multifactor/AbstractMultiFactorIT.groovy @@ -34,7 +34,9 @@ import com.stormpath.sdk.phone.Phone import javax.imageio.ImageIO import java.awt.image.BufferedImage -import static org.testng.AssertJUnit.* +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertNotNull +import static org.testng.Assert.assertNull /** * @since 1.1.0 @@ -96,7 +98,7 @@ abstract class AbstractMultiFactorIT extends ClientIT{ } } - assertEquals(URLDecoder.decode(expectedKeyUri, "UTF-8"), URLDecoder.decode(actualKeyUri, "UTF-8")) + assertEquals(URLDecoder.decode(actualKeyUri, "UTF-8"), URLDecoder.decode(expectedKeyUri, "UTF-8")) assertNotNull(factor.getBase64QrImage()) assertBase64EncodedQRCodeEncodesString(factor.getBase64QrImage(), expectedKeyUri) @@ -130,7 +132,7 @@ abstract class AbstractMultiFactorIT extends ClientIT{ protected void assertInitialChallengeFields(Challenge challenge, String expectedChallengeStatus = 'CREATED', boolean expectDefaultMessage = true) { if (expectDefaultMessage) { - assertEquals(challenge.message,'Your verification code is ${code}') + assertEquals(challenge.message, 'Your verification code is ${code}') } assertEquals(challenge.status as String, expectedChallengeStatus) assertNotNull(challenge.factor) diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/phone/PhoneIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/phone/PhoneIT.groovy index d6d33f23f5..180a07abd5 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/phone/PhoneIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/phone/PhoneIT.groovy @@ -1,7 +1,7 @@ /* * Copyright 2016 Stormpath, Inc. * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Apache License, Version 2.0 (the "License") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -25,10 +25,11 @@ import com.stormpath.sdk.phone.PhoneVerificationStatus import com.stormpath.sdk.phone.Phones import com.stormpath.sdk.resource.ResourceException import org.testng.annotations.Test -import static org.testng.Assert.* -import static org.testng.AssertJUnit.assertEquals -import static org.testng.AssertJUnit.assertNotNull -import static org.testng.AssertJUnit.assertTrue + +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertNotNull +import static org.testng.Assert.assertNull +import static org.testng.Assert.assertTrue /** * @since 1.1.0 @@ -60,14 +61,14 @@ class PhoneIT extends ClientIT { //create a phone: def phone = client.instantiate(Phone) phone.setNumber("888 391 5282") - phone = account.createPhone(phone); + phone = account.createPhone(phone) assertNotNull phone.href - assertEquals phone.number,"+18883915282" + assertEquals phone.number, "+18883915282" assertNull phone.name assertNull phone.description assertEquals phone.verificationStatus, PhoneVerificationStatus.UNVERIFIED - assertEquals phone.status,PhoneStatus.ENABLED + assertEquals phone.status, PhoneStatus.ENABLED assertNotNull phone.createdAt assertNotNull phone.modifiedAt assertNotNull phone.account @@ -78,11 +79,11 @@ class PhoneIT extends ClientIT { //should have same values assertNotNull phone.href - assertEquals phone.number,"+18883915282" + assertEquals phone.number, "+18883915282" assertNull phone.name assertNull phone.description assertEquals phone.verificationStatus, PhoneVerificationStatus.UNVERIFIED - assertEquals phone.status,PhoneStatus.ENABLED + assertEquals phone.status, PhoneStatus.ENABLED assertNotNull phone.createdAt assertNotNull phone.modifiedAt assertNotNull phone.account @@ -96,11 +97,11 @@ class PhoneIT extends ClientIT { phone2 = account.createPhone(builder.build()) assertNotNull phone2.href - assertEquals phone2.number,"+18883915288" + assertEquals phone2.number, "+18883915288" assertNull phone2.name assertNull phone2.description assertEquals phone2.verificationStatus, PhoneVerificationStatus.UNVERIFIED - assertEquals phone2.status,PhoneStatus.ENABLED + assertEquals phone2.status, PhoneStatus.ENABLED assertNotNull phone2.createdAt assertNotNull phone2.modifiedAt assertNotNull phone2.account @@ -111,11 +112,11 @@ class PhoneIT extends ClientIT { //should have same values assertNotNull phone2.href - assertEquals phone2.number,"+18883915288" + assertEquals phone2.number, "+18883915288" assertNull phone2.name assertNull phone2.description assertEquals phone2.verificationStatus, PhoneVerificationStatus.UNVERIFIED - assertEquals phone2.status,PhoneStatus.ENABLED + assertEquals phone2.status, PhoneStatus.ENABLED assertNotNull phone2.createdAt assertNotNull phone2.modifiedAt assertNotNull phone2.account @@ -154,12 +155,12 @@ class PhoneIT extends ClientIT { .setDescription(description) .setVerificationStatus(PhoneVerificationStatus.VERIFIED) .setStatus(PhoneStatus.DISABLED) - phone = account.createPhone(phone); + phone = account.createPhone(phone) - assertEquals(phone.number ,phoneNumber) + assertEquals(phone.number, phoneNumber) assertEquals(phone.name, name) assertEquals(phone.description, description) - assertEquals(phone.verificationStatus,PhoneVerificationStatus.VERIFIED) + assertEquals(phone.verificationStatus, PhoneVerificationStatus.VERIFIED) assertEquals(phone.status, PhoneStatus.DISABLED) assertNotNull(phone.createdAt) assertNotNull(phone.modifiedAt) @@ -198,12 +199,12 @@ class PhoneIT extends ClientIT { .setName(name) .setDescription(description) .setStatus(PhoneStatus.DISABLED) - phone = account.createPhone(phone); + phone = account.createPhone(phone) assertEquals(phone.number ,phoneNumber) assertNotNull(phone.name) assertNotNull(phone.description) - assertEquals(phone.verificationStatus,PhoneVerificationStatus.UNVERIFIED) + assertEquals(phone.verificationStatus, PhoneVerificationStatus.UNVERIFIED) assertEquals(phone.status, PhoneStatus.DISABLED) assertNotNull(phone.createdAt) assertNotNull(phone.modifiedAt) @@ -213,7 +214,7 @@ class PhoneIT extends ClientIT { //should not be able to update to garbage number phone.setNumber("bogus") - Throwable e = null; + Throwable e = null try{ phone.save() } @@ -261,7 +262,7 @@ class PhoneIT extends ClientIT { phone.setNumber("+18008675309") - e = null; + e = null try{ phone.save() } @@ -300,21 +301,21 @@ class PhoneIT extends ClientIT { deleteOnTeardown(dir) PhoneList phoneList = client.getResource(account.href+"/phones", PhoneList) - assertEquals(phoneList.size,0) + assertEquals(phoneList.size, 0) //create a phone: def phoneNumber = "+18883915282" def phone = client.instantiate(Phone) phone.setNumber(phoneNumber) - account.createPhone(phone); + account.createPhone(phone) def phoneNumber2 = "+18883528249" phone = client.instantiate(Phone) phone.setNumber(phoneNumber2) - account.createPhone(phone); + account.createPhone(phone) phoneList = client.getResource(account.href+"/phones", PhoneList) - assertEquals(phoneList.size,2) + assertEquals(phoneList.size, 2) } @Test @@ -344,7 +345,7 @@ class PhoneIT extends ClientIT { Throwable e = null try{ - account.createPhone(phone); + account.createPhone(phone) } catch(ResourceException re){ e=re @@ -358,7 +359,7 @@ class PhoneIT extends ClientIT { phone.setNumber("+188839152822222222") e = null try{ - account.createPhone(phone); + account.createPhone(phone) } catch(ResourceException re){ e = re @@ -373,7 +374,7 @@ class PhoneIT extends ClientIT { e = null try{ - account.createPhone(phone); + account.createPhone(phone) } catch(ResourceException re){ e = re @@ -388,7 +389,7 @@ class PhoneIT extends ClientIT { e = null try{ - account.createPhone(phone); + account.createPhone(phone) } catch(ResourceException re){ e = re @@ -402,13 +403,13 @@ class PhoneIT extends ClientIT { def phoneNumber = "+18883915282" phone = client.instantiate(Phone) phone.setNumber(phoneNumber) - account.createPhone(phone); + account.createPhone(phone) phone = client.instantiate(Phone) phone.setNumber(phoneNumber) e = null try{ - account.createPhone(phone); + account.createPhone(phone) } catch(ResourceException re){ e = re @@ -446,17 +447,17 @@ class PhoneIT extends ClientIT { def phoneNumber = "2016549571" def phone = client.instantiate(Phone) .setNumber(phoneNumber) - phone = account.createPhone(phone); + phone = account.createPhone(phone) def phoneNumber2 = "2026549572" def phone2 = client.instantiate(Phone) .setNumber(phoneNumber2) - account.createPhone(phone2); + account.createPhone(phone2) account.delete() - Throwable e = null; + Throwable e = null try{ client.getResource(account.href, Account) } @@ -468,7 +469,7 @@ class PhoneIT extends ClientIT { assertTrue(e instanceof ResourceException) - e = null; + e = null try{ client.getResource(phone.href, Phone) } @@ -512,12 +513,12 @@ class PhoneIT extends ClientIT { def phone2 = client.instantiate(Phone) .setNumber(phoneNumber2) - phone = account.createPhone(phone); - account.createPhone(phone2); + phone = account.createPhone(phone) + account.createPhone(phone2) phone.delete() - Throwable e = null; + Throwable e = null try{ client.getResource(phone.href, Phone) } @@ -536,7 +537,7 @@ class PhoneIT extends ClientIT { //should be able to recreate phone def phone3 = client.instantiate(Phone) .setNumber(phoneNumber) - account.createPhone(phone3); + account.createPhone(phone3) } @Test @@ -588,32 +589,32 @@ class PhoneIT extends ClientIT { account.createPhone(phone3) - Map queryParams = new HashMap(); - queryParams.put("name", "Storm*"); + Map queryParams = new HashMap() + queryParams.put("name", "Storm*") PhoneList phoneList = account.getPhones(queryParams) assertEquals(phoneList.size, 1) - queryParams = new HashMap(); - queryParams.put("name", "Stormtrooper's Phone"); + queryParams = new HashMap() + queryParams.put("name", "Stormtrooper's Phone") phoneList = account.getPhones(queryParams) assertEquals(phoneList.size, 1) - queryParams = new HashMap(); - queryParams.put("description", "Storm*"); + queryParams = new HashMap() + queryParams.put("description", "Storm*") phoneList = account.getPhones(queryParams) assertEquals(phoneList.size, 1) - queryParams = new HashMap(); - queryParams.put("description", "*Description"); + queryParams = new HashMap() + queryParams.put("description", "*Description") phoneList = account.getPhones(queryParams) assertEquals(phoneList.size, 2) - queryParams = new HashMap(); - queryParams.put("number", "+18883915282"); + queryParams = new HashMap() + queryParams.put("number", "+18883915282") phoneList = account.getPhones(queryParams) assertEquals(phoneList.size, 1) @@ -657,34 +658,34 @@ class PhoneIT extends ClientIT { deleteOnTeardown(phone2) //Let's check we have 2 phones and the account is not materialized - def phones = account.getPhones(Phones.criteria().orderByName().ascending()); - assertEquals(phones.getLimit(), 25); - assertEquals(phones.getProperty("items").size, 2); + def phones = account.getPhones(Phones.criteria().orderByName().ascending()) + assertEquals(phones.getLimit(), 25) + assertEquals(phones.getProperty("items").size, 2) assertEquals(phones.iterator().next().account.materialized, false) //Let's retrieve 1 phone per page and confirm that the account is materialized - phones = account.getPhones(Phones.criteria().limitTo(1).withAccount().orderByName().ascending()); - assertEquals(phones.getLimit(), 1); - assertEquals(phones.getProperty("items").size, 1); - assertEquals(phones.getOffset(), 0); + phones = account.getPhones(Phones.criteria().limitTo(1).withAccount().orderByName().ascending()) + assertEquals(phones.getLimit(), 1) + assertEquals(phones.getProperty("items").size, 1) + assertEquals(phones.getOffset(), 0) assertEquals(phones.iterator().next().account.materialized, true) - Phone firstPhoneWithOffset0 = phones.iterator().next(); + Phone firstPhoneWithOffset0 = phones.iterator().next() - assertNotNull(firstPhoneWithOffset0); - assertEquals(firstPhoneWithOffset0.getHref(), phone1.getHref()); + assertNotNull(firstPhoneWithOffset0) + assertEquals(firstPhoneWithOffset0.getHref(), phone1.getHref()) //Since we have 2 phones and offset = 1 here, then this page should only have 1 phone, the last one - phones = account.getPhones(Phones.criteria().offsetBy(1).orderByName().ascending()); - assertEquals(phones.getLimit(), 25); - assertEquals(phones.getProperty("items").size, 1); - assertEquals(phones.getOffset(), 1); + phones = account.getPhones(Phones.criteria().offsetBy(1).orderByName().ascending()) + assertEquals(phones.getLimit(), 25) + assertEquals(phones.getProperty("items").size, 1) + assertEquals(phones.getOffset(), 1) - Phone firstPhoneWithOffset1 = phones.iterator().next(); + Phone firstPhoneWithOffset1 = phones.iterator().next() - assertNotNull(firstPhoneWithOffset1); - assertEquals(firstPhoneWithOffset1.getHref(), phone2.getHref()); + assertNotNull(firstPhoneWithOffset1) + assertEquals(firstPhoneWithOffset1.getHref(), phone2.getHref()) - assertTrue(firstPhoneWithOffset0.getHref() != firstPhoneWithOffset1.getHref()); + assertTrue(firstPhoneWithOffset0.getHref() != firstPhoneWithOffset1.getHref()) } } diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/RegisteredSamlServiceProviderIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/RegisteredSamlServiceProviderIT.groovy index 9bb9462a7c..8a61e2b6f7 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/RegisteredSamlServiceProviderIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/RegisteredSamlServiceProviderIT.groovy @@ -17,13 +17,21 @@ package com.stormpath.sdk.impl.saml import com.stormpath.sdk.query.Options import com.stormpath.sdk.resource.ResourceException -import com.stormpath.sdk.saml.* +import com.stormpath.sdk.saml.RegisteredSamlServiceProvider +import com.stormpath.sdk.saml.RegisteredSamlServiceProviderList +import com.stormpath.sdk.saml.RegisteredSamlServiceProviders +import com.stormpath.sdk.saml.SamlIdentityProvider +import com.stormpath.sdk.saml.SamlIdentityProviders +import com.stormpath.sdk.saml.SamlServiceProviderRegistration +import com.stormpath.sdk.saml.SamlServiceProviderRegistrationList import com.stormpath.sdk.tenant.Tenant import com.stormpath.sdk.tenant.Tenants import org.testng.annotations.AfterMethod import org.testng.annotations.Test -import static org.testng.AssertJUnit.* +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertNotNull +import static org.testng.Assert.assertTrue /** * @since 1.3.0 diff --git a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/SAMLServiceProviderRegistrationIT.groovy b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/SAMLServiceProviderRegistrationIT.groovy index 603eca1ef5..5ca745ba6c 100644 --- a/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/SAMLServiceProviderRegistrationIT.groovy +++ b/extensions/httpclient/src/test/groovy/com/stormpath/sdk/impl/saml/SAMLServiceProviderRegistrationIT.groovy @@ -5,12 +5,20 @@ package com.stormpath.sdk.impl.saml import com.stormpath.sdk.application.Application import com.stormpath.sdk.query.Options -import com.stormpath.sdk.saml.* +import com.stormpath.sdk.saml.RegisteredSamlServiceProvider +import com.stormpath.sdk.saml.RegisteredSamlServiceProviderList +import com.stormpath.sdk.saml.SamlIdentityProvider +import com.stormpath.sdk.saml.SamlIdentityProviders +import com.stormpath.sdk.saml.SamlPolicy +import com.stormpath.sdk.saml.SamlServiceProviderRegistration +import com.stormpath.sdk.saml.SamlServiceProviderRegistrationList +import com.stormpath.sdk.saml.SamlServiceProviderRegistrationStatus +import com.stormpath.sdk.saml.SamlServiceProviderRegistrations import org.testng.annotations.AfterMethod import org.testng.annotations.Test -import static org.testng.AssertJUnit.assertEquals -import static org.testng.AssertJUnit.assertNotNull +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertNotNull class SamlServiceProviderRegistrationIT extends AbstractSamlIT { diff --git a/extensions/spring/stormpath-spring-security/src/test/groovy/com/stormpath/spring/security/provider/UsernamePasswordAuthenticationTokenFactoryTest.groovy b/extensions/spring/stormpath-spring-security/src/test/groovy/com/stormpath/spring/security/provider/UsernamePasswordAuthenticationTokenFactoryTest.groovy index abb0a25ac9..c737fa036b 100644 --- a/extensions/spring/stormpath-spring-security/src/test/groovy/com/stormpath/spring/security/provider/UsernamePasswordAuthenticationTokenFactoryTest.groovy +++ b/extensions/spring/stormpath-spring-security/src/test/groovy/com/stormpath/spring/security/provider/UsernamePasswordAuthenticationTokenFactoryTest.groovy @@ -24,11 +24,15 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority import org.springframework.security.core.userdetails.UserDetails import org.testng.annotations.Test -import static org.easymock.EasyMock.* +import static org.easymock.EasyMock.createStrictMock +import static org.easymock.EasyMock.expect +import static org.easymock.EasyMock.replay +import static org.easymock.EasyMock.verify import static org.hamcrest.MatcherAssert.assertThat import static org.hamcrest.core.IsInstanceOf.instanceOf -import static org.testng.Assert.* -import static org.testng.AssertJUnit.assertArrayEquals +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertNotNull +import static org.testng.Assert.assertTrue class UsernamePasswordAuthenticationTokenFactoryTest { @@ -59,10 +63,10 @@ class UsernamePasswordAuthenticationTokenFactoryTest { def token = authenticationTokenFactory.createAuthenticationToken("foo", "bar", gas, account) assertNotNull token assertThat token, instanceOf(UsernamePasswordAuthenticationToken.class) - assertEquals acctHref, ((UserDetails)token.principal).getUsername() - assertEquals "bar", token.getCredentials() - assertArrayEquals gas.toArray(), token.getAuthorities().toArray() - assertEquals gas.size(), token.getAuthorities().size() + assertEquals(((UserDetails)token.principal).getUsername(), acctHref) + assertEquals token.getCredentials(), "bar" + assertEquals token.getAuthorities().toArray(), gas.toArray() + assertEquals token.getAuthorities().size(), gas.size() assertTrue(((UserDetails)token.principal).enabled) assertTrue(((UserDetails)token.principal).accountNonLocked) assertTrue(((UserDetails)token.principal).accountNonExpired) diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/api/DefaultApiKeyTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/api/DefaultApiKeyTest.groovy index a4f7820fae..13333a8469 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/api/DefaultApiKeyTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/api/DefaultApiKeyTest.groovy @@ -5,8 +5,10 @@ import org.testng.annotations.BeforeTest import org.testng.annotations.Test import static org.easymock.EasyMock.createMock -import static org.testng.Assert.* -import static org.testng.AssertJUnit.assertTrue +import static org.testng.Assert.assertEquals +import static org.testng.Assert.assertFalse +import static org.testng.Assert.assertNull +import static org.testng.Assert.assertTrue /** * Note: Most of DefaultApiKey is covered by other tests. This test fills out the coverage to be 100% diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/client/DefaultClientBuilderTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/client/DefaultClientBuilderTest.groovy index a953dd5701..9a713e952a 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/client/DefaultClientBuilderTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/client/DefaultClientBuilderTest.groovy @@ -22,9 +22,9 @@ import static org.easymock.EasyMock.createStrictMock import static org.easymock.EasyMock.expect import static org.easymock.EasyMock.replay import static org.easymock.EasyMock.verify +import static org.testng.Assert.assertEquals import static org.testng.Assert.assertTrue -import static org.testng.AssertJUnit.assertEquals -import static org.testng.AssertJUnit.fail +import static org.testng.Assert.fail class DefaultClientBuilderTest { diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/config/JSONPropertiesSourceTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/config/JSONPropertiesSourceTest.groovy index 80ce0aef7a..91661c2b03 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/config/JSONPropertiesSourceTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/config/JSONPropertiesSourceTest.groovy @@ -4,7 +4,7 @@ import org.testng.annotations.Test import static org.testng.Assert.assertEquals import static org.testng.Assert.fail -import static org.testng.AssertJUnit.assertTrue +import static org.testng.Assert.assertTrue /** * @since 1.0 diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/config/ResourcePropertiesSourceTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/config/ResourcePropertiesSourceTest.groovy index 54a99e56dc..f912d1c744 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/config/ResourcePropertiesSourceTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/config/ResourcePropertiesSourceTest.groovy @@ -5,7 +5,7 @@ import org.testng.annotations.Test import static org.testng.Assert.assertEquals import static org.testng.Assert.fail -import static org.testng.AssertJUnit.assertTrue +import static org.testng.Assert.assertTrue /** * @since 1.0.RC9 diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/config/YAMLPropertiesSourceTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/config/YAMLPropertiesSourceTest.groovy index deb21f0a9d..adf62d6a5f 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/config/YAMLPropertiesSourceTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/config/YAMLPropertiesSourceTest.groovy @@ -4,7 +4,7 @@ import org.testng.annotations.Test import static org.testng.Assert.assertEquals import static org.testng.Assert.fail -import static org.testng.AssertJUnit.assertTrue +import static org.testng.Assert.assertTrue /** * @since 1.0 */ diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/idsite/DefaultNonceTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/idsite/DefaultNonceTest.groovy index 3aa6b2cd36..052c5e38ac 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/idsite/DefaultNonceTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/idsite/DefaultNonceTest.groovy @@ -3,7 +3,7 @@ package com.stormpath.sdk.impl.idsite import org.testng.annotations.Test import static org.testng.Assert.assertEquals -import static org.testng.AssertJUnit.fail +import static org.testng.Assert.fail /** * @since 1.0.RC9 diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/io/ClasspathResourceTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/io/ClasspathResourceTest.groovy index 75a02ca8fb..27f7f99aff 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/io/ClasspathResourceTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/io/ClasspathResourceTest.groovy @@ -2,7 +2,7 @@ package com.stormpath.sdk.impl.io import org.testng.annotations.Test -import static org.testng.AssertJUnit.assertNotNull +import static org.testng.Assert.assertNotNull /** * @since 1.0.RC9 diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/io/DefaultResourceFactoryTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/io/DefaultResourceFactoryTest.groovy index dbf92ba167..0a86253760 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/io/DefaultResourceFactoryTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/io/DefaultResourceFactoryTest.groovy @@ -3,7 +3,7 @@ package com.stormpath.sdk.impl.io import org.testng.annotations.BeforeMethod import org.testng.annotations.Test -import static org.testng.AssertJUnit.assertTrue +import static org.testng.Assert.assertTrue /** * @since 1.0.RC9 diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/io/StringResourceTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/io/StringResourceTest.groovy index e40d78a437..399731b510 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/io/StringResourceTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/io/StringResourceTest.groovy @@ -6,7 +6,7 @@ import java.nio.charset.Charset import static org.testng.Assert.assertEquals import static org.testng.Assert.fail -import static org.testng.AssertJUnit.assertNotNull +import static org.testng.Assert.assertNotNull /** * @since 1.0.RC9 diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/DefaultOAuthGrantRequestAuthenticationResultBuilderTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/DefaultOAuthGrantRequestAuthenticationResultBuilderTest.groovy index 645143c6fc..fa160616b8 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/DefaultOAuthGrantRequestAuthenticationResultBuilderTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/DefaultOAuthGrantRequestAuthenticationResultBuilderTest.groovy @@ -15,10 +15,10 @@ */ package com.stormpath.sdk.impl.oauth -import org.testng.annotations.Test; +import org.testng.annotations.Test import static org.testng.Assert.assertEquals -import static org.testng.AssertJUnit.fail +import static org.testng.Assert.fail /** * Test for OAuthGrantRequestAuthenticationResultBuilder class diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/DefaultOAuthPasswordGrantRequestAuthenticationBuilderTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/DefaultOAuthPasswordGrantRequestAuthenticationBuilderTest.groovy index 2bc0bf74b6..a635b83975 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/DefaultOAuthPasswordGrantRequestAuthenticationBuilderTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/DefaultOAuthPasswordGrantRequestAuthenticationBuilderTest.groovy @@ -21,8 +21,8 @@ import org.testng.annotations.Test import static org.easymock.EasyMock.createMock import static org.testng.Assert.assertSame -import static org.testng.AssertJUnit.assertEquals -import static org.testng.AssertJUnit.fail +import static org.testng.Assert.assertEquals +import static org.testng.Assert.fail /** * Test for PasswordGrantRequestBuilder class diff --git a/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/IdSiteAuthenticationRequestBuilderTest.groovy b/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/IdSiteAuthenticationRequestBuilderTest.groovy index 903359496f..28aabd767d 100644 --- a/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/IdSiteAuthenticationRequestBuilderTest.groovy +++ b/impl/src/test/groovy/com/stormpath/sdk/impl/oauth/IdSiteAuthenticationRequestBuilderTest.groovy @@ -19,7 +19,7 @@ import com.stormpath.sdk.oauth.IdSiteAuthenticationRequest import org.testng.annotations.Test import static org.testng.Assert.assertEquals -import static org.testng.AssertJUnit.fail +import static org.testng.Assert.fail /** * Test for IdSiteAuthenticationRequestBuilder class