VersionTitleProvider { public String getVersionTitle() { String versionTitle = packageProvider.getPackageOfObject(this).getImplementationTitle(); return versionTitle != null ? versionTitle : NOT_FOUND; }  String getVersionTitle();  }
@Test public void testWhenManifestsExistsVersionTitleShouldBeReturned() { given(packageProvider.getPackageOfObject(underTest)).willReturn(packageOfUnderTest); given(packageOfUnderTest.getImplementationTitle()).willReturn("something"); String result = underTest.getVersionTitle(); assertEquals("something", result); }
@Test public void testWhenManifestsNotFoundTextShouldBeReturned() { given(packageProvider.getPackageOfObject(underTest)).willReturn(packageOfUnderTest); given(packageOfUnderTest.getImplementationTitle()).willReturn(null); String result = underTest.getVersionTitle(); assertEquals(NOT_FOUND, result); }