Search in sources :

Example 16 with BootEvent

use of org.apache.servicecomb.core.BootListener.BootEvent in project java-chassis by ServiceComb.

the class TestAuthHandlerBoot method testGenerateRSAKey.

@Test
public void testGenerateRSAKey() {
    MicroserviceInstance microserviceInstance = new MicroserviceInstance();
    Microservice microservice = new Microservice();
    microservice.setInstance(microserviceInstance);
    AuthHandlerBoot authHandlerBoot = new AuthHandlerBoot();
    BootEvent bootEvent = new BootEvent();
    bootEvent.setEventType(BootListener.EventType.BEFORE_REGISTRY);
    authHandlerBoot.onBootEvent(bootEvent);
    Assert.assertNotNull(RSAKeypair4Auth.INSTANCE.getPrivateKey());
    Assert.assertNotNull(RSAKeypair4Auth.INSTANCE.getPublicKey());
}
Also used : Microservice(org.apache.servicecomb.registry.api.registry.Microservice) AuthHandlerBoot(org.apache.servicecomb.AuthHandlerBoot) BootEvent(org.apache.servicecomb.core.BootListener.BootEvent) MicroserviceInstance(org.apache.servicecomb.registry.api.registry.MicroserviceInstance) Test(org.junit.Test)

Aggregations

BootEvent (org.apache.servicecomb.core.BootListener.BootEvent)16 Test (org.junit.Test)13 SCBEngine (org.apache.servicecomb.core.SCBEngine)6 ProducerProviderManager (org.apache.servicecomb.core.provider.producer.ProducerProviderManager)5 ArrayList (java.util.ArrayList)4 ProducerMeta (org.apache.servicecomb.core.provider.producer.ProducerMeta)4 Expectations (mockit.Expectations)3 AuthHandlerBoot (org.apache.servicecomb.AuthHandlerBoot)3 MicroserviceMeta (org.apache.servicecomb.core.definition.MicroserviceMeta)2 LogCollector (org.apache.servicecomb.foundation.test.scaffolding.log.LogCollector)2 Executor (java.util.concurrent.Executor)1 ExecutorService (java.util.concurrent.ExecutorService)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Mock (mockit.Mock)1 MockUp (mockit.MockUp)1 EventType (org.apache.servicecomb.core.BootListener.EventType)1 SchemaMeta (org.apache.servicecomb.core.definition.SchemaMeta)1 GroupExecutor (org.apache.servicecomb.core.executor.GroupExecutor)1 Holder (org.apache.servicecomb.foundation.common.Holder)1 HealthCheckerRestPublisher (org.apache.servicecomb.metrics.core.publish.HealthCheckerRestPublisher)1