Assert.fail("The required parameter must never be null and if so must cause a NPE being thrown: country=" + country); //NOI18N
}
- @Test (description = "Tests Country.countryEntryCreated getter/setter")
- public void testCountryEntryCreated () {
- // Empty instance
- final Country country = new CountryData();
- final Date date = new Date();
-
- // Set it
- country.setCountryEntryCreated(date);
-
- // Should be the same!
- Assert.assertEquals(country.getCountryEntryCreated(), date);
- }
-
- @Test (description = "Tests Country.countryEntryUpdated getter/setter")
- public void testCountryEntryUpdated () {
- // Empty instance
- final Country country = new CountryData();
- final Date date = new Date();
-
- // Set it
- country.setCountryEntryUpdated(date);
-
- // Should be the same!
- Assert.assertEquals(country.getCountryEntryUpdated(), date);
- }
-
@Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider")
public void testCountry1EqualsDifferentAbroadDialPrefix (final Country country1, final Country country2) {
// First change countryAbroadDialPrefix to something else
Assert.assertTrue(country.equals(country));
}
+ @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider")
+ public void testCountry2EqualsDifferentAbroadDialPrefix (final Country country1, final Country country2) {
+ // First change countryAbroadDialPrefix to something else
+ country2.setCountryAbroadDialPrefix("++"); //NOI18N
+ Assert.assertFalse(country1.equals(country2));
+ country2.setCountryAbroadDialPrefix(ABROAD_DIAL_PREFIX);
+ }
+
+ @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider")
+ public void testCountry2EqualsDifferentCountryCode (final Country country1, final Country country2) {
+ // Next is countryCode
+ country2.setCountryCode("XX"); //NOI18N
+ Assert.assertFalse(country1.equals(country2));
+ country2.setCountryCode(COUNTRY_CODE);
+ }
+
+ @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider")
+ public void testCountry2EqualsDifferentCountryId (final Country country1, final Country country2) {
+ // Next is countryId
+ country2.setCountryId(1l); //NOI18N
+ Assert.assertFalse(country1.equals(country2));
+ country2.setCountryId(null);
+ }
+
+ @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider")
+ public void testCountry2EqualsDifferentExternalDialPrefix (final Country country1, final Country country2) {
+ // Next is countryExternalDialPrefix
+ country2.setCountryExternalDialPrefix("00"); //NOI18N
+ Assert.assertFalse(country1.equals(country2));
+ country2.setCountryCode(EXTERNAL_DIAL_PREFIX);
+ }
+
+ @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider")
+ public void testCountry2EqualsDifferentI18nKey (final Country country1, final Country country2) {
+ // Next is countryI18nKey
+ country2.setCountryI18nKey("COUNTRY_XX"); //NOI18N
+ Assert.assertFalse(country1.equals(country2));
+ country2.setCountryI18nKey(COUNTRY_I18N_KEY);
+ }
+
+ @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider")
+ public void testCountry2EqualsDifferentIsLocalDialPrefixRequired (final Country country1, final Country country2) {
+ // Next is countryId
+ country2.setCountryIsLocalPrefixRequired(Boolean.FALSE);
+ Assert.assertFalse(country1.equals(country2));
+ country2.setCountryIsLocalPrefixRequired(Boolean.TRUE);
+ }
+
+ @Test (description = "Tests if Country.equals() returns false when a field has been changed to an other value", dataProvider = "same-country-provider")
+ public void testCountry2EqualsDifferentPhoneCode (final Country country1, final Country country2) {
+ // Next is countryId
+ country2.setCountryPhoneCode(COUNTRY_PHONE_CODE0);
+ Assert.assertFalse(country1.equals(country2));
+ country2.setCountryPhoneCode(COUNTRY_PHONE_CODE1);
+ }
+
+ @Test (description = "Tests Country.countryEntryCreated getter/setter")
+ public void testCountryEntryCreated () {
+ // Empty instance
+ final Country country = new CountryData();
+ final Date date = new Date();
+
+ // Set it
+ country.setCountryEntryCreated(date);
+
+ // Should be the same!
+ Assert.assertEquals(country.getCountryEntryCreated(), date);
+ }
+
+ @Test (description = "Tests Country.countryEntryUpdated getter/setter")
+ public void testCountryEntryUpdated () {
+ // Empty instance
+ final Country country = new CountryData();
+ final Date date = new Date();
+
+ // Set it
+ country.setCountryEntryUpdated(date);
+
+ // Should be the same!
+ Assert.assertEquals(country.getCountryEntryUpdated(), date);
+ }
+
}