@Test public void setupWithOneCompleteConfigTest() { doReturn(false).when(aboutPopupConfigs).isUnsatisfied(); doReturn(false).when(aboutPopupConfigs).isAmbiguous(); doReturn(config).when(aboutPopupConfigs).get(); aboutPopup.setup(); verify(view).init(aboutPopup); verify(view).setProductName(config.productName()); verify(view).setProductVersion(config.productVersion()); verify(view).setProductLicense(config.productLicense()); verify(view).setProductImageUrl(config.productImageUrl()); verify(view).setBackgroundImageUrl(config.backgroundImageUrl()); }
@PostConstruct public void setup() { view.init(this); if (aboutPopupConfigs.isUnsatisfied()) { throw new RuntimeException("One AboutPopupConfig implementation must be provided"); } if (aboutPopupConfigs.isAmbiguous()) { throw new RuntimeException("Only one AboutPopupConfig implementation must be provided"); } final AboutPopupConfig aboutPopupConfig = aboutPopupConfigs.get(); view.setProductName(aboutPopupConfig.productName()); view.setProductVersion(aboutPopupConfig.productVersion()); view.setProductLicense(aboutPopupConfig.productLicense()); view.setProductImageUrl(aboutPopupConfig.productImageUrl()); final String backgroundImageUrl = aboutPopupConfig.backgroundImageUrl(); if (backgroundImageUrl != null && !backgroundImageUrl.isEmpty()) { view.setBackgroundImageUrl(backgroundImageUrl); } }
AboutPopup { @PostConstruct public void setup() { view.init(this); if (aboutPopupConfigs.isUnsatisfied()) { throw new RuntimeException("One AboutPopupConfig implementation must be provided"); } if (aboutPopupConfigs.isAmbiguous()) { throw new RuntimeException("Only one AboutPopupConfig implementation must be provided"); } final AboutPopupConfig aboutPopupConfig = aboutPopupConfigs.get(); view.setProductName(aboutPopupConfig.productName()); view.setProductVersion(aboutPopupConfig.productVersion()); view.setProductLicense(aboutPopupConfig.productLicense()); view.setProductImageUrl(aboutPopupConfig.productImageUrl()); final String backgroundImageUrl = aboutPopupConfig.backgroundImageUrl(); if (backgroundImageUrl != null && !backgroundImageUrl.isEmpty()) { view.setBackgroundImageUrl(backgroundImageUrl); } } }
AboutPopup { @PostConstruct public void setup() { view.init(this); if (aboutPopupConfigs.isUnsatisfied()) { throw new RuntimeException("One AboutPopupConfig implementation must be provided"); } if (aboutPopupConfigs.isAmbiguous()) { throw new RuntimeException("Only one AboutPopupConfig implementation must be provided"); } final AboutPopupConfig aboutPopupConfig = aboutPopupConfigs.get(); view.setProductName(aboutPopupConfig.productName()); view.setProductVersion(aboutPopupConfig.productVersion()); view.setProductLicense(aboutPopupConfig.productLicense()); view.setProductImageUrl(aboutPopupConfig.productImageUrl()); final String backgroundImageUrl = aboutPopupConfig.backgroundImageUrl(); if (backgroundImageUrl != null && !backgroundImageUrl.isEmpty()) { view.setBackgroundImageUrl(backgroundImageUrl); } } @Inject  AboutPopup(final View view,
                      final ManagedInstance<AboutPopupConfig> aboutPopupConfigs); }
AboutPopup { @PostConstruct public void setup() { view.init(this); if (aboutPopupConfigs.isUnsatisfied()) { throw new RuntimeException("One AboutPopupConfig implementation must be provided"); } if (aboutPopupConfigs.isAmbiguous()) { throw new RuntimeException("Only one AboutPopupConfig implementation must be provided"); } final AboutPopupConfig aboutPopupConfig = aboutPopupConfigs.get(); view.setProductName(aboutPopupConfig.productName()); view.setProductVersion(aboutPopupConfig.productVersion()); view.setProductLicense(aboutPopupConfig.productLicense()); view.setProductImageUrl(aboutPopupConfig.productImageUrl()); final String backgroundImageUrl = aboutPopupConfig.backgroundImageUrl(); if (backgroundImageUrl != null && !backgroundImageUrl.isEmpty()) { view.setBackgroundImageUrl(backgroundImageUrl); } } @Inject  AboutPopup(final View view,
                      final ManagedInstance<AboutPopupConfig> aboutPopupConfigs); @PostConstruct void setup(); void show(); }
AboutPopup { @PostConstruct public void setup() { view.init(this); if (aboutPopupConfigs.isUnsatisfied()) { throw new RuntimeException("One AboutPopupConfig implementation must be provided"); } if (aboutPopupConfigs.isAmbiguous()) { throw new RuntimeException("Only one AboutPopupConfig implementation must be provided"); } final AboutPopupConfig aboutPopupConfig = aboutPopupConfigs.get(); view.setProductName(aboutPopupConfig.productName()); view.setProductVersion(aboutPopupConfig.productVersion()); view.setProductLicense(aboutPopupConfig.productLicense()); view.setProductImageUrl(aboutPopupConfig.productImageUrl()); final String backgroundImageUrl = aboutPopupConfig.backgroundImageUrl(); if (backgroundImageUrl != null && !backgroundImageUrl.isEmpty()) { view.setBackgroundImageUrl(backgroundImageUrl); } } @Inject  AboutPopup(final View view,
                      final ManagedInstance<AboutPopupConfig> aboutPopupConfigs); @PostConstruct void setup(); void show();  }