Replaced all tabs with spaces in java and pom.xml
[so.git] / common / src / test / java / org / onap / so / client / aai / entities / uri / IncorrectNumberOfUriKeysTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.client.aai.entities.uri;
22
23 import static org.hamcrest.CoreMatchers.equalTo;
24 import static org.mockito.Mockito.mock;
25 import static org.mockito.Mockito.when;
26 import org.junit.Rule;
27 import org.junit.Test;
28 import org.junit.rules.ExpectedException;
29 import org.onap.so.client.aai.AAIObjectPlurals;
30 import org.onap.so.client.aai.AAIObjectType;
31 import org.onap.so.client.graphinventory.exceptions.IncorrectNumberOfUriKeys;
32
33 public class IncorrectNumberOfUriKeysTest {
34
35     @Rule
36     public ExpectedException thrown = ExpectedException.none();
37
38     @Test
39     public void verifyIncorrectNumberOfKeysSingle() {
40
41         thrown.expect(IncorrectNumberOfUriKeys.class);
42         thrown.expectMessage(equalTo("Expected 3 variables: [cloud-owner, cloud-region-id, volume-group-id]"));
43         AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, "volume-group-id");
44
45     }
46
47     @Test
48     public void verifyIncorrectNumberOfKeysPlural() {
49
50         thrown.expect(IncorrectNumberOfUriKeys.class);
51         AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VOLUME_GROUP, "my-cloud-owner");
52
53     }
54
55     @Test
56     public void verifyIncorrectNumberOfKeysFromParent() {
57
58         thrown.expect(IncorrectNumberOfUriKeys.class);
59         AAIResourceUri parentUri =
60                 AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, "my-cloud-owner", "my-cloud-region-id");
61         AAIResourceUri uri = AAIUriFactory.createResourceFromParentURI(parentUri, AAIObjectType.VOLUME_GROUP);
62     }
63
64     @Test
65     public void verifyIncorrectNumberOfKeysHttpAware() {
66
67         thrown.expect(IncorrectNumberOfUriKeys.class);
68         AAIResourceUri uri =
69                 AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "customer-id", "subscription-id");
70     }
71 }