### Question:
DefaultPmoNlsService implements PmoNlsService { @Override public String getLabel(Class<?> pmoClass, String propertyName, String aspectName, String fallbackValue) { return getLabel(pmoClass, PmoNlsService.getPropertyKey(pmoClass, propertyName, aspectName), fallbackValue); } DefaultPmoNlsService();  DefaultPmoNlsService(PmoBundleNameGenerator bundleNameGenerator); @Override String getSectionCaption(Class<?> pmoClass, String fallbackValue); @Override String getLabel(Class<?> pmoClass, String propertyName, String aspectName, String fallbackValue);  }### Answer:
@Test public void testGetLabel() { DefaultPmoNlsService defaultPmoNlsService = new DefaultPmoNlsService(); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, PROPERTY_TEST, "", "foo"), is("no aspect")); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, PROPERTY_TEST, "bla", "fallback"), is("blubb")); }
@Test public void testGetLabel_Fallback() { DefaultPmoNlsService defaultPmoNlsService = new DefaultPmoNlsService(); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, PROPERTY_NOT_PRESENT, "", "foo"), is("foo")); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, PROPERTY_NOT_PRESENT, "bla", "fallback"), is("fallback")); }
@Test public void testGetLabel_Locale() { TestUiFramework.get().setUiLocale(Locale.GERMAN); DefaultPmoNlsService defaultPmoNlsService = new DefaultPmoNlsService(); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, PROPERTY_TEST, "", "foo"), is("Kein Aspekt")); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, PROPERTY_TEST, "bla", "fallback"), is("BlaBla")); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, "only", "german", "Subsidiaritätsprinzip"), is("Streichholzschächtelchen")); TestUiFramework.get().setUiLocale(Locale.ENGLISH); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, "only", "german", "Subsidiaritätsprinzip"), is("Subsidiaritätsprinzip")); }
@Test public void testGetLabel_OtherPmoBundleNameGenerator() { DefaultPmoNlsService defaultPmoNlsService = new DefaultPmoNlsService( pmoClass -> "messages." + pmoClass.getName().replace('.', '_')); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, PROPERTY_TEST, "", "foo"), is("other no aspect")); assertThat(defaultPmoNlsService.getLabel(DefaultPmoNlsServiceTest.class, PROPERTY_TEST, "bla", "fallback"), is("blubber")); }