Howdy!
I was doing the migration work and found out something funny:
For Installations, we have `installation.setDeviceType()`, but during
Installation `persist()`, the DeviceTokenValidator is called, which in
turn looks for a Variant.
So after fiddling with some orm settings suddenly a bunch of tests
started to break, which led me to this snippet[1]:
// disabled
Installation android3 = new Installation();
android3.setAlias("foo(a)bar.org");
android3.setDeviceToken("543234234890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
android3.setDeviceType("Android Tablet");
android3.setEnabled(false);
installationDao.create(android3);
See, our tests are creating an installation without associating it to a
variant first, then it blows up here[2]:
// DeviceTokenValidator#isValid()
if (installation.getVariant() == null || installation.getVariant().getType() == null ||
deviceToken == null) {
return false;
}
This is smelling like a bug to me - kinda like the validator wasn't
actually running during tests. Am I crazy?
[
1]:https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/mo...
[
2]:https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/mo...
--
qmx