congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
BaseUiService$UiNgResourceForwarding
Code IndexAdd Tabnine to your IDE (free)

How to use
BaseUiService$UiNgResourceForwarding
in
com.vmware.admiral

Best Java code snippets using com.vmware.admiral.BaseUiService$UiNgResourceForwarding (Showing top 8 results out of 315)

origin: vmware/admiral

@Test
public void testAuthorizeRequest() {
  UiNgResourceForwarding service = new UiNgResourceForwarding("/sample", "/sample-new");
  AtomicBoolean completionCalled = new AtomicBoolean();
  service.authorizeRequest(new Operation().setCompletion((o, e) -> {
    completionCalled.set(true);
  }));
  assertTrue(completionCalled.get());
}
origin: vmware/admiral

@Override
public void handleGet(Operation get) {
  if (redirectToLoginOrIndex(getHost(), get)) {
    return;
  operation.setUri(UriUtils.buildUri(getHost(), uriPath))
      .setCompletion((o, e) -> {
        get.setBody(o.getBodyRaw())
  sendRequest(operation);
origin: vmware/admiral

public UiNgResourceForwarding(String sourcePath, String targetPath, boolean redirect) {
  this.sourcePath = sourcePath;
  this.targetPath = targetPath;
  this.redirect = redirect;
  setSelfLink(sourcePath);
  this.options.add(ServiceOption.URI_NAMESPACE_OWNER);
}
origin: vmware/admiral

@Test
public void testForwardIndexHtml() {
  UiNgResourceForwarding service = new UiNgResourceForwarding("/sample/", "/sample-new/") {
    @Override
    public void sendRequest(Operation op) {
      if (op.getUri().getPath().equals("/sample-new/index.html")) {
        op.setBody("OK");
        op.complete();
      }
    }
  };
  service.setHost(VerificationHost.create());
  AtomicBoolean completionCalled = new AtomicBoolean();
  service.handleGet(new Operation().setUri(UriUtils.buildUri("http://localhost/sample/"))
      .setCompletion((o, e) -> {
        assertEquals("OK", o.getBodyRaw());
        completionCalled.set(true);
      }));
  assertTrue(completionCalled.get());
}
origin: vmware/admiral

@Test
public void testForward() {
  UiNgResourceForwarding service = new UiNgResourceForwarding("/sample", "/sample-new") {
    @Override
    public void sendRequest(Operation op) {
      if (op.getUri().getPath().equals("/sample-new")) {
        op.setBody("OK");
        op.complete();
      }
    }
  };
  service.setHost(VerificationHost.create());
  AtomicBoolean completionCalled = new AtomicBoolean();
  service.handleGet(new Operation().setUri(UriUtils.buildUri("http://localhost/sample"))
      .setCompletion((o, e) -> {
        assertEquals("OK", o.getBodyRaw());
        completionCalled.set(true);
      }));
  assertTrue(completionCalled.get());
}
origin: vmware/admiral

protected void startRedirectService(String sourcePath, String targetPath) {
  Operation post = Operation
      .createPost(UriUtils.buildUri(getHost(), sourcePath));
  UiNgResourceForwarding rf = new UiNgResourceForwarding(sourcePath, targetPath, true);
  getHost().startService(post, rf);
}
origin: vmware/admiral

@Test
public void testRedirect() {
  UiNgResourceForwarding service = new UiNgResourceForwarding("/sample", "/sample-new", true);
  service.setHost(VerificationHost.create());
  AtomicBoolean completionCalled = new AtomicBoolean();
  service.handleGet(new Operation().setUri(UriUtils.buildUri("http://localhost/sample"))
      .setCompletion((o, e) -> {
        assertEquals("/sample-new", o.getResponseHeader(Operation.LOCATION_HEADER));
        completionCalled.set(true);
      }));
  assertTrue(completionCalled.get());
}
origin: vmware/admiral

protected void startForwardingService(String sourcePath, String targetPath) {
  Operation post = Operation
      .createPost(UriUtils.buildUri(getHost(), sourcePath));
  UiNgResourceForwarding rf = new UiNgResourceForwarding(sourcePath, targetPath);
  getHost().startService(post, rf);
}
com.vmware.admiralBaseUiService$UiNgResourceForwarding

Most used methods

  • <init>
  • authorizeRequest
  • getHost
  • handleGet
  • sendRequest
  • setHost
  • setSelfLink

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JCheckBox (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Join (org.hibernate.mapping)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now