Commit b1bec45c authored by Bill Wang's avatar Bill Wang
Browse files

clean up

parent 0261a7dd
Pipeline #60883 canceled with stages
in 1 minute and 24 seconds
......@@ -67,7 +67,7 @@
<dependency>
<groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId>
<version>0.10.0</version>
<version>0.11.0-SNAPSHOT</version>
</dependency>
<dependency>
......
// Copyright © 2020 Amazon Web Services
//
// 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 org.opengroup.osdu.schema.provider.aws.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
@Component
public class AwsServiceConfig {
@Value("${aws.region}")
@Getter()
@Setter(AccessLevel.PROTECTED)
public String amazonRegion;
@Value("${aws.resource.prefix}")
@Getter()
@Setter(AccessLevel.PROTECTED)
public String environment;
@Value("${aws.ssm}")
@Getter()
@Setter(AccessLevel.PROTECTED)
public Boolean ssmEnabled;
}
......@@ -22,7 +22,6 @@ import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.BadRequestException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.model.Authority;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.opengroup.osdu.schema.provider.aws.models.AuthorityDoc;
import org.opengroup.osdu.schema.provider.interfaces.schemainfostore.IAuthorityStore;
import org.springframework.beans.factory.annotation.Value;
......
......@@ -20,7 +20,6 @@ import com.amazonaws.services.s3.model.PutObjectRequest;
import org.opengroup.osdu.core.aws.s3.IS3ClientFactory;
import org.opengroup.osdu.core.aws.s3.S3ClientWithBucket;
import org.opengroup.osdu.core.aws.s3.S3Config;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.schema.constants.SchemaConstants;
......@@ -30,7 +29,6 @@ import org.opengroup.osdu.schema.provider.interfaces.schemastore.ISchemaStore;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
......
......@@ -31,7 +31,6 @@ import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.BadRequestException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.model.Authority;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.opengroup.osdu.schema.provider.aws.models.AuthorityDoc;
import static org.junit.Assert.assertEquals;
......@@ -42,9 +41,6 @@ public class AwsAuthorityStoreTest {
@InjectMocks
private AwsAuthorityStore authorityStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -59,8 +55,6 @@ public class AwsAuthorityStoreTest {
@Before
public void setUp() throws Exception {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
Mockito.when(queryHelperFactory.getQueryHelperForPartition(Mockito.any(DpsHeaders.class), Mockito.any()))
.thenReturn(queryHelper);
......
......@@ -31,7 +31,6 @@ import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.BadRequestException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.model.EntityType;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.opengroup.osdu.schema.provider.aws.models.EntityTypeDoc;
import static org.junit.Assert.assertEquals;
......@@ -42,8 +41,6 @@ public class AwsEntityTypeStoreTest {
@InjectMocks
private AwsEntityTypeStore entityTypeStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -59,8 +56,6 @@ public class AwsEntityTypeStoreTest {
@Before
public void setUp() throws Exception {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
Mockito.when(queryHelperFactory.getQueryHelperForPartition(Mockito.any(DpsHeaders.class), Mockito.any()))
.thenReturn(queryHelper);
......
......@@ -28,7 +28,6 @@ import org.opengroup.osdu.core.aws.dynamodb.DynamoDBQueryHelperV2;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.springframework.test.util.ReflectionTestUtils;
@RunWith(MockitoJUnitRunner.class)
......@@ -37,9 +36,6 @@ public class AwsSchemaInfoStoreTest {
@InjectMocks
private AwsSchemaInfoStore schemaInfoStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -54,8 +50,6 @@ public class AwsSchemaInfoStoreTest {
@Before
public void setUp() throws Exception {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
ReflectionTestUtils.setField(schemaInfoStore, "sharedTenant", "common");
......
......@@ -29,7 +29,7 @@ import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.BadRequestException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.model.Source;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import org.mockito.junit.MockitoJUnitRunner;
import org.opengroup.osdu.schema.provider.aws.models.SourceDoc;
......@@ -41,8 +41,6 @@ public class AwsSourceStoreTest {
@InjectMocks
private AwsSourceStore sourceStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -58,8 +56,6 @@ public class AwsSourceStoreTest {
@Before
public void setUp() throws Exception {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
Mockito.when(queryHelperFactory.getQueryHelperForPartition(Mockito.any(DpsHeaders.class), Mockito.any()))
.thenReturn(queryHelper);
......
......@@ -30,7 +30,6 @@ import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.schema.constants.SchemaConstants;
import org.opengroup.osdu.schema.exceptions.ApplicationException;
import org.opengroup.osdu.schema.exceptions.NotFoundException;
import org.opengroup.osdu.schema.provider.aws.config.AwsServiceConfig;
import java.net.MalformedURLException;
import java.net.URL;
......@@ -44,8 +43,6 @@ public class AwsSchemaStoreTest {
@InjectMocks
private AwsSchemaStore schemaStore;
@Mock
private AwsServiceConfig serviceConfig;
@Mock
private DpsHeaders headers;
......@@ -74,8 +71,6 @@ public class AwsSchemaStoreTest {
@Before
public void setUp() {
serviceConfig.amazonRegion = "us-east-1";
serviceConfig.environment = "test";
Mockito.when(s3ClientWithBucket.getS3Client()).thenReturn(s3);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment