when(mockEntityManager.find(eq(Package.class), any())).thenReturn(mockPackage);
when(mockPackage.getPackageType()).thenReturn(mockPackageType);
PackageVersion mockPackageVersion = mock(PackageVersion.class);
when(mockContentManager.persistPackageVersion(isNotNull(PackageVersion.class)))
.thenReturn(mockPackageVersion);
when(mockEntityManager.find(eq(PackageVersion.class), anyInt())).thenReturn(mockPackageVersion);
when(mockPackageVersion.getGeneralPackage()).thenReturn(mockPackage);
when(mockPackageVersion.getArchitecture()).thenReturn(mockArchitecture);