@@ -0,0 +1,3383 @@
+package com.mesosphere.dcos.cassandra.scheduler.resources;%0A%0Aimport com.fasterxml.jackson.datatype.guava.GuavaModule;%0Aimport com.fasterxml.jackson.datatype.jdk8.Jdk8Module;%0Aimport com.google.common.io.Resources;%0Aimport com.mesosphere.dcos.cassandra.common.config.CassandraConfig;%0Aimport com.mesosphere.dcos.cassandra.common.serialization.IntegerStringSerializer;%0Aimport com.mesosphere.dcos.cassandra.scheduler.config.*;%0Aimport com.mesosphere.dcos.cassandra.scheduler.persistence.ZooKeeperPersistence;%0Aimport io.dropwizard.configuration.ConfigurationFactory;%0Aimport io.dropwizard.configuration.EnvironmentVariableSubstitutor;%0Aimport io.dropwizard.configuration.FileConfigurationSourceProvider;%0Aimport io.dropwizard.configuration.SubstitutingSourceProvider;%0Aimport io.dropwizard.jackson.Jackson;%0Aimport io.dropwizard.testing.junit.ResourceTestRule;%0Aimport io.dropwizard.validation.BaseValidator;%0Aimport org.apache.curator.test.TestingServer;%0Aimport org.junit.AfterClass;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0A%0Aimport java.util.Optional;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Apublic class IdentityResourceTest %7B%0A    private static TestingServer server;%0A%0A    private static ZooKeeperPersistence persistence;%0A%0A    private static CassandraSchedulerConfiguration config;%0A%0A    private static IdentityManager manager;%0A%0A    @Rule%0A    public final ResourceTestRule resources = ResourceTestRule.builder()%0A            .addResource(new IdentityResource(manager)).build();%0A%0A    @BeforeClass%0A    public static void beforeAll() throws Exception %7B%0A%0A        server = new TestingServer();%0A%0A        server.start();%0A%0A        final ConfigurationFactory%3CCassandraSchedulerConfiguration%3E factory =%0A                new ConfigurationFactory%3C%3E(%0A                        CassandraSchedulerConfiguration.class,%0A                        BaseValidator.newValidator(),%0A                        Jackson.newObjectMapper().registerModule(%0A                                new GuavaModule())%0A                                .registerModule(new Jdk8Module()),%0A                        %22dw%22);%0A%0A        config = factory.build(%0A                new SubstitutingSourceProvider(%0A                        new FileConfigurationSourceProvider(),%0A                        new EnvironmentVariableSubstitutor(false)),%0A                Resources.getResource(%22scheduler.yml%22).getFile());%0A%0A        Identity initial = config.getIdentity();%0A%0A        persistence = (ZooKeeperPersistence) ZooKeeperPersistence.create(%0A                initial,%0A                CuratorFrameworkConfig.create(server.getConnectString(),%0A                        10000L,%0A                        10000L,%0A                        Optional.empty(),%0A                        250L));%0A%0A        manager = new IdentityManager(%0A                initial,%0A                persistence,%0A                Identity.JSON_SERIALIZER);%0A%0A        manager.start();%0A%0A    %7D%0A%0A    @AfterClass%0A    public static void afterAll() throws Exception %7B%0A%0A        manager.stop();%0A%0A        persistence.stop();%0A%0A        server.close();%0A%0A        server.stop();%0A    %7D%0A%0A    @Test%0A    public void testGetIdentity() throws Exception %7B%0A        Identity identity = resources.client().target(%22/v1/framework%22).request()%0A                .get(Identity.class);%0A        System.out.println(%22identity = %22 + identity);%0A        assertEquals(config.getIdentity(), identity);%0A    %7D%0A%7D%0A

Add IdentityResourceTest and add tests