// Path: src/main/java/com/proofpoint/cloudmanagement/service/InMemoryManagerModule.java
// public static class InMemoryTagManager implements TagManager
// {
//     private final LoadingCache<String, Set<String>> tagCache =
//             CacheBuilder.newBuilder()
//                     .build(new CacheLoader<String, Set<String>>()
//                     {
// 
//                         @Override
//                         public Set<String> load(String key)
//                                 throws Exception
//                         {
//                             return new ConcurrentHashSet<String>();
//                         }
//                     });
// 
//     @Override
//     public TagUpdateStatus addTag(Instance instance, String tag)
//     {
//         tagCache.getUnchecked(instance.getId()).add(tag);
//         return TagUpdateStatus.UPDATED;
//     }
// 
//     @Override
//     public TagUpdateStatus deleteTag(Instance instance, String tag)
//     {
//         tagCache.getUnchecked(instance.getId()).remove(tag);
//         return TagUpdateStatus.UPDATED;
//     }
// 
//     @Override
//     public Iterable<String> getTags(Instance instance)
//     {
//         return tagCache.getUnchecked(instance.getId());
//     }
// }
// 
// Path: src/main/java/com/proofpoint/cloudmanagement/service/InMemoryManagerModule.java
// public static class NoOpDnsManager implements DnsManager
// {
//     @Override
//     public String getFullyQualifiedDomainName(Instance instance)
//     {
//         return instance.getHostname();
//     }
// }


import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.proofpoint.cloudmanagement.service.InMemoryManagerModule.InMemoryTagManager;
import com.proofpoint.cloudmanagement.service.InMemoryManagerModule.NoOpDnsManager;
import com.proofpoint.jaxrs.testing.MockUriInfo;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import java.net.URI;
import java.util.UUID;
import static org.testng.Assert.assertEquals;
/*
 * Copyright 2010 Proofpoint, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.proofpoint.cloudmanagement.service;




public class TestInstanceResource
{
    private InstanceResource instanceResource;
    private InMemoryInstanceConnector inMemoryInstanceConnector;

    private static final UriInfo INSTANCE_URI_INFO = MockUriInfo.from("http://localhost/v1/instance");
// Path: src/main/java/com/proofpoint/cloudmanagement/service/InMemoryManagerModule.java
// public static class InMemoryTagManager implements TagManager
// {
//     private final LoadingCache<String, Set<String>> tagCache =
//             CacheBuilder.newBuilder()
//                     .build(new CacheLoader<String, Set<String>>()
//                     {
// 
//                         @Override
//                         public Set<String> load(String key)
//                                 throws Exception
//                         {
//                             return new ConcurrentHashSet<String>();
//                         }
//                     });
// 
//     @Override
//     public TagUpdateStatus addTag(Instance instance, String tag)
//     {
//         tagCache.getUnchecked(instance.getId()).add(tag);
//         return TagUpdateStatus.UPDATED;
//     }
// 
//     @Override
//     public TagUpdateStatus deleteTag(Instance instance, String tag)
//     {
//         tagCache.getUnchecked(instance.getId()).remove(tag);
//         return TagUpdateStatus.UPDATED;
//     }
// 
//     @Override
//     public Iterable<String> getTags(Instance instance)
//     {
//         return tagCache.getUnchecked(instance.getId());
//     }
// }
// 
// Path: src/main/java/com/proofpoint/cloudmanagement/service/InMemoryManagerModule.java
// public static class NoOpDnsManager implements DnsManager
// {
//     @Override
//     public String getFullyQualifiedDomainName(Instance instance)
//     {
//         return instance.getHostname();
//     }
// }


// Path: src/test/java/com/proofpoint/cloudmanagement/service/TestInstanceResource.java
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.proofpoint.cloudmanagement.service.InMemoryManagerModule.InMemoryTagManager;
import com.proofpoint.cloudmanagement.service.InMemoryManagerModule.NoOpDnsManager;
import com.proofpoint.jaxrs.testing.MockUriInfo;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import java.net.URI;
import java.util.UUID;
import static org.testng.Assert.assertEquals;

/*
 * Copyright 2010 Proofpoint, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.proofpoint.cloudmanagement.service;




public class TestInstanceResource
{
    private InstanceResource instanceResource;
    private InMemoryInstanceConnector inMemoryInstanceConnector;

    private static final UriInfo INSTANCE_URI_INFO = MockUriInfo.from("http://localhost/v1/instance");
    private InMemoryTagManager tagManager;