@@ -0,0 +1,2273 @@
+/*%0A *%0A *  * Licensed to the Apache Software Foundation (ASF) under one or more%0A *  *  contributor license agreements.  The ASF licenses this file to You%0A *  * under the Apache License, Version 2.0 (the %22License%22); you may not%0A *  * use this file except in compliance with the License.%0A *  * You may obtain a copy of the License at%0A *  *%0A *  *     http://www.apache.org/licenses/LICENSE-2.0%0A *  *%0A *  * Unless required by applicable law or agreed to in writing, software%0A *  * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  * See the License for the specific language governing permissions and%0A *  * limitations under the License.  For additional information regarding%0A *  * copyright in this work, please see the NOTICE file in the top level%0A *  * directory of this distribution.%0A *%0A */%0A%0Apackage org.apache.usergrid.rest;%0A%0Aimport com.fasterxml.jackson.databind.JsonNode;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport javax.ws.rs.core.MediaType;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport java.util.UUID;%0A%0Aimport static org.junit.Assert.assertNull;%0A%0A/**%0A * Classy class class.%0A */%0Apublic class IndexResourceIT extends AbstractRestIT %7B%0A%0A%0A    @Rule%0A    public TestContextSetup context = new TestContextSetup( this );%0A    //Used for all MUUserResourceITTests%0A    private Logger LOG = LoggerFactory.getLogger(IndexResourceIT.class);%0A%0A    public IndexResourceIT()%7B%0A%0A    %7D%0A%0A    @Test%0A    public void TestAddIndex() throws Exception%7B%0A        String superToken = superAdminToken();%0A%0A        Map%3CString, Object%3E data = new HashMap%3CString, Object%3E();%0A        data.put( %22replicas%22, 0 );%0A        data.put( %22shards%22, 1 );%0A%0A        UUID appId = this.context.getAppUuid();%0A%0A        // change the password as admin. The old password isn't required%0A        JsonNode node = mapper.readTree( resource().path( %22/index/%22+appId ).queryParam( %22access_token%22, superToken )%0A                .accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE )%0A                .post( String.class, data ));%0A%0A        assertNull( getError( node ) );%0A%0A        refreshIndex(%22test-organization%22, %22test-app%22);%0A%0A    %7D%0A%7D%0A

add index test