FrameworkInfoFactory { public Protos.FrameworkInfo.Builder getBuilder() { final Protos.FrameworkInfo.Builder frameworkBuilder = Protos.FrameworkInfo.newBuilder(); frameworkBuilder.setUser(""); frameworkBuilder.setName(configuration.getFrameworkName()); frameworkBuilder.setFailoverTimeout(configuration.getFailoverTimeout()); frameworkBuilder.setCheckpoint(true); frameworkBuilder.setRole(configuration.getFrameworkRole()); setWebuiUrl(frameworkBuilder); setFrameworkId(frameworkBuilder); setFrameworkPrincipal(frameworkBuilder); return frameworkBuilder; } FrameworkInfoFactory(Configuration configuration, FrameworkState frameworkState); Protos.FrameworkInfo.Builder getBuilder();  }
@Test public void shouldGetBuilder() { FrameworkInfoFactory frameworkInfoFactory = new FrameworkInfoFactory(configuration, frameworkState); Protos.FrameworkInfo frameworkInfo = frameworkInfoFactory.getBuilder().build(); assertTrue(frameworkInfo.getWebuiUrl().contains("http: assertTrue(frameworkInfo.getWebuiUrl().contains(Integer.toString(DUMMY_PORT))); assertEquals(DUMMY_FRAMEWORK_ROLE, frameworkInfo.getRole()); }
@Test public void shouldReturnPrincipalIfEnabled() { when(configuration.getFrameworkPrincipal()).thenReturn(PRINCIPAL); FrameworkInfoFactory frameworkInfoFactory = new FrameworkInfoFactory(configuration, frameworkState); Protos.FrameworkInfo frameworkInfo = frameworkInfoFactory.getBuilder().build(); assertTrue(frameworkInfo.getPrincipal().equals(PRINCIPAL)); }