when(mockEntityManager.createNamedQuery(eq(Architecture.QUERY_FIND_BY_NAME))).thenReturn(mockQuery);
when(mockEntityManager.createNamedQuery(eq(Package.QUERY_FIND_BY_NAME_PKG_TYPE_ID))).thenReturn(mockQuery);
ContentManagerLocal mockContentManager = mock(ContentManagerLocal.class);
Package mockPackage = mock(Package.class);
when(mockContentManager.persistPackage(isNotNull(Package.class))).thenReturn(mockPackage);
when(mockEntityManager.find(eq(Package.class), any())).thenReturn(mockPackage);
when(mockPackage.getPackageType()).thenReturn(mockPackageType);
PackageVersion mockPackageVersion = mock(PackageVersion.class);