DefaultTenantResolver implements TenantResolver, ServletRequestListener { @Override public Tenant resolve(String host) { return this.resolve(host, null); }  void requestDestroyed(); @Override Tenant resolve(String host); @Override Tenant resolve(String host, String path); @Override void requestDestroyed(ServletRequestEvent sre); @Override void requestInitialized(ServletRequestEvent sre);  }
@Test public void testMultitenancyNotActivatedReturnsDefaultTenant1() throws Exception { this.setUpExpectationsForMultitenancyNotActivated(); assertNotNull(this.tenantResolver.resolve("mayocatshop.com")); assertEquals("mytenant", this.tenantResolver.resolve("mayocatshop.com").getSlug()); }
@Test public void testMultitenancyNotActivatedReturnsDefaultTenant2() throws Exception { this.setUpExpectationsForMultitenancyNotActivated(); assertNotNull(this.tenantResolver.resolve("localhost")); assertEquals("mytenant", this.tenantResolver.resolve("localhost").getSlug()); }
@Test public void testMultitenancyTenantResolver1() throws Exception { this.setUpExpectationsForMultitenancyActivated(); assertNotNull(this.tenantResolver.resolve("mytenant.mayocatshop.com")); assertEquals("mytenant", this.tenantResolver.resolve("mytenant.mayocatshop.com").getSlug()); }
@Test public void testMultitenancyTenantResolver2() throws Exception { this.setUpExpectationsForMultitenancyActivated(); assertNotNull(this.tenantResolver.resolve("mytenant.localhost")); assertEquals("mytenant", this.tenantResolver.resolve("mytenant.localhost").getSlug()); }
@Test public void testMultitenancyTenantResolver3() throws Exception { this.setUpExpectationsForMultitenancyActivated(); assertNull(this.tenantResolver.resolve("localhost")); }
@Test public void testMultitenancyTenantResolver4() throws Exception { this.setUpExpectationsForMultitenancyActivated(); assertNull(this.tenantResolver.resolve("mayocatshop.com")); }