CompanyIdIndexNameBuilder implements ElasticsearchConfigurationObserver, IndexNameBuilder { @Activate protected void activate() { elasticsearchConfigurationWrapper.register(this); setIndexNamePrefix(elasticsearchConfigurationWrapper.indexNamePrefix()); }  @Override int compareTo(
		ElasticsearchConfigurationObserver elasticsearchConfigurationObserver); @Override String getIndexName(long companyId); @Override int getPriority(); @Override void onElasticsearchConfigurationUpdate();  }
@Test public void testActivate() throws Exception { ElasticsearchConfigurationWrapper elasticsearchConfigurationWrapperMock = Mockito.mock( ElasticsearchConfigurationWrapper.class); Mockito.when( elasticsearchConfigurationWrapperMock.indexNamePrefix() ).thenReturn( "UPPERCASE" ); CompanyIdIndexNameBuilder companyIdIndexNameBuilder = new CompanyIdIndexNameBuilder() { { elasticsearchConfigurationWrapper = elasticsearchConfigurationWrapperMock; } }; companyIdIndexNameBuilder.activate(); Assert.assertEquals( "uppercase0", companyIdIndexNameBuilder.getIndexName(0)); }