Skip to content

Commit dc7803a

Browse files
xuhuijingxuhuijing
authored andcommitted
add mesh test
1 parent 2273996 commit dc7803a

File tree

5 files changed

+110
-2
lines changed

5 files changed

+110
-2
lines changed

capa-spi-aws-mesh/src/main/java/group/rxcloud/capa/spi/aws/mesh/constants/AwsRpcConstants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package group.rxcloud.capa.spi.aws.mesh.constants;
1818

19-
2019
public interface AwsRpcConstants {
2120

2221
interface Environments {

capa-spi-aws-mesh/src/main/java/group/rxcloud/capa/spi/aws/mesh/http/serialzer/AwsCapaSerialzerProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package group.rxcloud.capa.spi.aws.mesh.http.serialzer;
1818

19-
2019
import group.rxcloud.capa.infrastructure.serializer.CapaObjectSerializer;
2120
import group.rxcloud.capa.infrastructure.serializer.DefaultObjectSerializer;
2221
import group.rxcloud.capa.spi.aws.mesh.env.AwsRpcEnvironment;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package group.rxcloud.capa.spi.aws.mesh.config;
18+
19+
import group.rxcloud.capa.infrastructure.env.CapaEnvironment;
20+
import org.junit.jupiter.api.Assertions;
21+
import org.junit.jupiter.api.Test;
22+
23+
public class AwsSpiOptionsLoaderTest {
24+
25+
@Test
26+
public void testLoadRpcServiceOptions_Success() {
27+
AwsSpiOptionsLoader awsSpiOptionsLoader = new AwsSpiOptionsLoader();
28+
29+
AwsRpcServiceOptions rpcServiceOptions = awsSpiOptionsLoader.loadRpcServiceOptions("appId");
30+
31+
Assertions.assertEquals("appId", rpcServiceOptions.getAppId());
32+
33+
AwsRpcServiceOptions.AwsToAwsServiceOptions awsToAwsServiceOptions = rpcServiceOptions.getAwsToAwsServiceOptions();
34+
35+
Assertions.assertEquals("appId", awsToAwsServiceOptions.getServiceId());
36+
Assertions.assertEquals(8080, awsToAwsServiceOptions.getServicePort());
37+
Assertions.assertEquals(CapaEnvironment.DeployVpcEnvironment.FWS, awsToAwsServiceOptions.getServiceEnv());
38+
}
39+
40+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package group.rxcloud.capa.spi.aws.mesh.env;
18+
19+
20+
import org.junit.jupiter.api.Assertions;
21+
import org.junit.jupiter.api.Test;
22+
23+
public class AwsRpcEnvironmentTest {
24+
25+
@Test
26+
public void testGetServicePort_SuccessWhenDefault() {
27+
int servicePort = AwsRpcEnvironment.getServicePort();
28+
Assertions.assertEquals(8080, servicePort);
29+
}
30+
31+
@Test
32+
public void testGetSerializer_SuccessWhenDefault() {
33+
String serializer = AwsRpcEnvironment.getSerializer();
34+
Assertions.assertEquals("baiji", serializer);
35+
}
36+
37+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package group.rxcloud.capa.spi.aws.mesh.http;
18+
19+
20+
import group.rxcloud.capa.infrastructure.serializer.CapaObjectSerializer;
21+
import group.rxcloud.capa.spi.aws.mesh.http.serialzer.AwsCapaSerialzerProvider;
22+
import org.junit.jupiter.api.Assertions;
23+
import org.junit.jupiter.api.Test;
24+
25+
public class AwsCapaSerialzerProviderTest {
26+
27+
@Test
28+
public void testGetSerializerOrDefault_Success() {
29+
CapaObjectSerializer serializerOrDefault = AwsCapaSerialzerProvider.getSerializerOrDefault(null);
30+
Assertions.assertEquals("application/bjjson", serializerOrDefault.getContentType());
31+
}
32+
33+
}

0 commit comments

Comments
 (0)