test_class.declarator: mockConfiguration
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Configuration mockConfiguration;
test_class.type: Configuration
test_class.var_name: mockConfiguration
test_class.file: gazeplay-commons/src/test/java/net/gazeplay/commons/utils/games/MenuUtilsTest.java
test_class.identifier: MenuUtilsTest
test_case.body: @Test
      void givenVersionIsKnown_givenProfileIsNamed_shouldBuildMenuBar() {
          when(mockConfiguration.getUserName()).thenReturn("test user name");
          new MockUp<ActiveConfigurationContext>() {
              @mockit.Mock
              public Configuration getInstance() {
                  return mockConfiguration;
              }
          };
          new MockUp<VersionInfo>() {
              @mockit.Mock
              public Optional<String> findVersionInfo(String id, boolean time) {
                  return Optional.of("v1.2.3");
              }
          };
  
          MenuBar menuBar = MenuUtils.buildMenuBar();
          assertEquals("GazePlay v1.2.3", menuBar.getMenus().get(0).getText());
          assertEquals("Current Profile: test user name", menuBar.getMenus().get(1).getText());
      }
test_case.class_method_signature: MenuUtilsTest.givenVersionIsKnown_givenProfileIsNamed_shouldBuildMenuBar()
test_case.full_signature: @Test void givenVersionIsKnown_givenProfileIsNamed_shouldBuildMenuBar()
test_case.identifier: givenVersionIsKnown_givenProfileIsNamed_shouldBuildMenuBar
test_case.invocations: thenReturn when getUserName of buildMenuBar assertEquals getText get getMenus assertEquals getText get getMenus
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void givenVersionIsKnown_givenProfileIsNamed_shouldBuildMenuBar()
focal_class.file: gazeplay-commons/src/main/java/net/gazeplay/commons/utils/games/MenuUtils.java
focal_class.identifier: MenuUtils
focal_class.class_method_signature: MenuUtils.buildMenuBar()
focal_class.full_signature: public static MenuBar buildMenuBar()
focal_class.identifier: buildMenuBar
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: MenuBar
focal_class.signature: MenuBar buildMenuBar()
focal_class.class_method_signature: MenuUtils.loadLicenseFileAsString(ClassLoader classLoader)
focal_class.full_signature: private static String loadLicenseFileAsString(ClassLoader classLoader)
focal_class.identifier: loadLicenseFileAsString
focal_class.modifiers: private static
focal_class.parameters: (ClassLoader classLoader)
focal_class.return: String
focal_class.signature: String loadLicenseFileAsString(ClassLoader classLoader)
focal_method.body: public static MenuBar buildMenuBar() {
          ClassLoader classLoader = ClassLoader.getSystemClassLoader();
          String licenseFileAsString = loadLicenseFileAsString(classLoader);
  
          @Nullable
          Optional<String> versionNumber = VersionInfo.findVersionInfo(VersionInfo.artifactId, false);
  
          MenuItem licenseMenuItem = new MenuItem(licenseFileAsString);
  
          Menu versionMenu = new Menu(versionNumber.map(value -> "GazePlay " + value).orElse("GazePlay unreleased version"));
          versionMenu.getItems().add(licenseMenuItem);
  
          String username = ActiveConfigurationContext.getInstance().getUserName();
          Menu profileMenu = new Menu("Current Profile: " + (username.isEmpty() ? "Default" : username));
  
          MenuBar menuBar = new MenuBar();
          menuBar.getMenus().addAll(versionMenu, profileMenu);
          menuBar.setPrefHeight(40);
          menuBar.setPrefWidth(80);
  
          return menuBar;
      }
focal_method.class_method_signature: MenuUtils.buildMenuBar()
focal_method.full_signature: public static MenuBar buildMenuBar()
focal_method.identifier: buildMenuBar
focal_method.invocations: getSystemClassLoader loadLicenseFileAsString findVersionInfo orElse map add getItems getUserName getInstance isEmpty addAll getMenus setPrefHeight setPrefWidth
focal_method.modifiers: public static
focal_method.parameters: ()
focal_method.return: MenuBar
focal_method.signature: MenuBar buildMenuBar()