//create object to test and inject required dependencies
ScriptComponent objectUnderTest = new ScriptComponent();
objectUnderTest.start(mockResourceContext);
//run code under test
Set<ResourcePackageDetails> result = objectUnderTest.discoverDeployedPackages(mockPackageType);
//verify the results (Assert and mock verification)
Assert.assertEquals(result.size(), 1);
ResourcePackageDetails resultPackageDetails = (ResourcePackageDetails) result.toArray()[0];