版本号修改为 2.0.0-snapshot

main
13009 2024-02-20 16:42:19 +08:00
parent 4140f63867
commit eb3060a379
14 changed files with 85 additions and 47 deletions

33
pom.xml
View File

@ -101,6 +101,39 @@
<artifactId>sonar-maven-plugin</artifactId> <artifactId>sonar-maven-plugin</artifactId>
<version>3.10.0.2594</version> <version>3.10.0.2594</version>
</plugin> </plugin>
<!-- <plugin>-->
<!-- <groupId>org.jacoco</groupId>-->
<!-- <artifactId>jacoco-maven-plugin</artifactId>-->
<!-- <version>0.8.11</version>-->
<!-- <configuration>-->
<!-- <destFile>${project.build.directory}/jacoco.exec</destFile>-->
<!-- <dataFile>${project.build.directory}/jacoco.exec</dataFile>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>prepare-agent</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- <execution>-->
<!-- <id>report</id>-->
<!-- <phase>prepare-package</phase>-->
<!-- <goals>-->
<!-- <goal>report</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- <execution>-->
<!-- <id>post-unit-test</id>-->
<!-- <phase>test</phase>-->
<!-- <goals>-->
<!-- <goal>report</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <dataFile>target/jacoco.exec</dataFile>-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>

View File

@ -1,5 +1,5 @@
sh mvn clean package verify sonar:sonar \ sh mvn clean package verify sonar:sonar \
-Dsonar.projectKey=scfs-api-sdk \ -Dsonar.projectKey=scfs-api-sdk \
-Dsonar.projectName=scfs-api-sdk \ -Dsonar.projectName=scfs-api-sdk \
-Dsonar.host.url=http://10.133.128.95:9000 \ -Dsonar.host.url=http://10.129.135.192:7100 \
-Dsonar.token=sqa_58ffad8c89ccb18f2f475e5f8f2a7f23c25b3b32 -Dsonar.login=sqp_90e5fb014f985e2c458e46b9239926cfbbd4fffe

View File

@ -17,7 +17,7 @@ public abstract class AbstractProfile implements Profile {
// http 客户端配置 // http 客户端配置
private final HttpProfile httpProfile; private final HttpProfile httpProfile;
public AbstractProfile(Privacy privacy, Signature signature, Channel channel, HttpProfile httpProfile) { protected AbstractProfile(Privacy privacy, Signature signature, Channel channel, HttpProfile httpProfile) {
this.privacy = privacy; this.privacy = privacy;
this.signature = signature; this.signature = signature;
this.channel = channel; this.channel = channel;

View File

@ -5,8 +5,9 @@ import com.czcb.scfs.api.core.exception.EncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.ThreadLocalRandom; import java.util.Random;
/** /**
* @author wangwei * @author wangwei
@ -14,6 +15,8 @@ import java.util.concurrent.ThreadLocalRandom;
*/ */
public class Strings { public class Strings {
private static final SecureRandom random = new SecureRandom();
private Strings() { private Strings() {
} }
@ -59,8 +62,8 @@ public class Strings {
return getRandom().nextInt(limit); return getRandom().nextInt(limit);
} }
private static ThreadLocalRandom getRandom() { private static Random getRandom() {
return ThreadLocalRandom.current(); return random;
} }
/** /**

View File

@ -1,14 +1,12 @@
package com.czcb.scfs.api.core.cipher; package com.czcb.scfs.api.core.cipher;
import org.junit.jupiter.api.Test;
class DefaultCredentialTest { class DefaultCredentialTest {
@Test // @Test
void buildRequestAuthorization() { // void buildRequestAuthorization() {
} // }
//
@Test // @Test
void buildResponseSignature() { // void buildResponseSignature() {
} // }
} }

View File

@ -1,10 +1,8 @@
package com.czcb.scfs.api.core.cipher; package com.czcb.scfs.api.core.cipher;
import org.junit.jupiter.api.Test;
class DefaultValidatorTest { class DefaultValidatorTest {
//
@Test // @Test
void validate() { // void validate() {
} // }
} }

View File

@ -6,7 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class EncodingExceptionTest { class EncodingExceptionTest {
@Test @Test
public void test() { void test() {
assertThrows(EncodingException.class, () -> { assertThrows(EncodingException.class, () -> {
throw new EncodingException(); throw new EncodingException();
}); });

View File

@ -7,7 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class EncryptExceptionTest { class EncryptExceptionTest {
@Test @Test
public void test() { void test() {
assertThrows(EncryptException.class, () -> { assertThrows(EncryptException.class, () -> {
throw new EncryptException(); throw new EncryptException();
}); });

View File

@ -6,7 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class ValidationExceptionTest { class ValidationExceptionTest {
@Test @Test
public void test() { void test() {
assertThrows(ValidationException.class, () -> { assertThrows(ValidationException.class, () -> {
throw new ValidationException(); throw new ValidationException();
}); });

View File

@ -1,22 +1,20 @@
package com.czcb.scfs.api.core.http; package com.czcb.scfs.api.core.http;
import org.junit.jupiter.api.Test;
class DefaultApiClientBuilderTest { class DefaultApiClientBuilderTest {
@Test // @Test
void newInstance() { // void newInstance() {
} // }
//
@Test // @Test
void profile() { // void profile() {
} // }
//
@Test // @Test
void httpClient() { // void httpClient() {
} // }
//
@Test // @Test
void build() { // void build() {
} // }
} }

View File

@ -14,7 +14,7 @@ class HttpRequestTest {
.url("/aa") .url("/aa")
.build(); .build();
Assertions.assertEquals(httpRequest.getHttpMethod(), HttpMethod.GET); Assertions.assertEquals(HttpMethod.GET, httpRequest.getHttpMethod());
} }
@Test @Test

View File

@ -1,9 +1,19 @@
package com.czcb.scfs.api.service.file; package com.czcb.scfs.api.service.file;
import com.czcb.scfs.api.core.ApiClient;
/** /**
* *
* *
* @since 2.0.0 * @since 2.0.0
*/ */
public class FileDownloadService { public class FileDownloadService {
private final ApiClient apiClient;
public FileDownloadService(ApiClient apiClient) {
this.apiClient = apiClient;
}
public void download() {
}
} }

View File

@ -1,10 +1,5 @@
package com.czcb.scfs.api.service.sms; package com.czcb.scfs.api.service.sms;
import org.junit.jupiter.api.Test;
class SmsServiceTest { class SmsServiceTest {
@Test
void send() {
}
} }

View File

@ -12,6 +12,9 @@ import java.security.cert.X509Certificate;
* @date 2024/2/20 * @date 2024/2/20
*/ */
public final class SMKeyText { public final class SMKeyText {
private SMKeyText() {
}
static { static {
Security.addProvider(new KonaProvider()); Security.addProvider(new KonaProvider());
} }