Skip to content

Commit

Permalink
Merge branch 'master' into source
Browse files Browse the repository at this point in the history
  • Loading branch information
cnzakii committed Oct 28, 2024
2 parents 3db2feb + 510cf2d commit 64fb42c
Show file tree
Hide file tree
Showing 71 changed files with 1,606 additions and 222 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- if: matrix.language == 'cpp' || matrix.language == 'csharp'
name: Build C
run: |
git submodule init
git submodule update
make -C ./eventmesh-sdks/eventmesh-sdk-c
- name: Build C SDK
if: matrix.language == 'cpp'
run: make -C ./eventmesh-sdks/eventmesh-sdk-c

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
It has been 60 days since the last activity on this pull request. I am reaching out here to gently remind you that the Apache EventMesh community values every pull request, and please feel free to get in touch with the reviewers at any time. They are available to assist you in advancing the progress of your pull request and offering the latest feedback.
If you encounter any challenges during development, seeking support within the community is encouraged. We sincerely appreciate your contributions to Apache EventMesh.
exempt-issue-labels: 'pinned,discussion,help wanted,WIP,weopen-star,GLCC,summer of code'
exempt-issue-labels: 'pinned,discussion,help wanted,WIP,weopen-star,GLCC,GSoC'
exempt-pr-labels: 'help wanted,dependencies'
exempt-all-milestones: true # Exempt all issues/PRs with milestones from stale
operations-per-run: 300
22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ buildscript {
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.13.0"

classpath "org.apache.httpcomponents:httpclient:4.5.14"
classpath "commons-io:commons-io:2.16.1"
classpath "commons-io:commons-io:2.17.0"
}
}

plugins {
id 'org.cyclonedx.bom' version '1.8.2'
id 'com.github.jk1.dependency-license-report' version '2.8'
id 'com.github.jk1.dependency-license-report' version '2.9'
}

allprojects {
Expand Down Expand Up @@ -109,7 +109,7 @@ allprojects {
url "https://maven.aliyun.com/repository/public"
}
}
testImplementation "org.junit.jupiter:junit-jupiter:5.10.3"
testImplementation "org.junit.jupiter:junit-jupiter:5.11.0"
}

spotless {
Expand Down Expand Up @@ -697,9 +697,9 @@ subprojects {
sign publishing.publications.mavenJava
}

def grpcVersion = '1.66.0'
def log4jVersion = '2.23.1'
def jacksonVersion = '2.17.2'
def grpcVersion = '1.68.0'
def log4jVersion = '2.24.1'
def jacksonVersion = '2.18.0'
def dropwizardMetricsVersion = '4.2.26'
def opentelemetryVersion = '1.36.0'
def cloudeventsVersion = '3.0.0'
Expand All @@ -711,9 +711,9 @@ subprojects {
dependency "org.apache.commons:commons-lang3:3.17.0"
dependency "org.apache.commons:commons-collections4:4.4"
dependency "org.apache.commons:commons-text:1.12.0"
dependency "commons-io:commons-io:2.16.1"
dependency "commons-io:commons-io:2.17.0"
dependency "commons-validator:commons-validator:1.9.0"
dependency "com.google.guava:guava:33.2.1-jre"
dependency "com.google.guava:guava:33.3.0-jre"

dependency "org.slf4j:slf4j-api:2.0.13"
dependency "org.apache.logging.log4j:log4j-api:${log4jVersion}"
Expand Down Expand Up @@ -757,7 +757,7 @@ subprojects {
dependency "org.springframework.boot:spring-boot-starter-web:2.7.18"
dependency "io.openmessaging:registry-server:0.0.1"

dependency "org.junit.jupiter:junit-jupiter:5.10.3"
dependency "org.junit.jupiter:junit-jupiter:5.11.0"
dependency "org.junit-pioneer:junit-pioneer:1.9.1"
dependency "org.assertj:assertj-core:3.26.3"

Expand Down Expand Up @@ -794,14 +794,14 @@ subprojects {
dependency "javax.annotation:javax.annotation-api:1.3.2"
dependency "com.alibaba.fastjson2:fastjson2:2.0.52"

dependency "software.amazon.awssdk:s3:2.26.3"
dependency "software.amazon.awssdk:s3:2.28.12"
dependency "com.github.rholder:guava-retrying:2.0.0"

dependency "com.alibaba:druid-spring-boot-starter:1.2.23"
dependency "com.baomidou:mybatis-plus-boot-starter:3.5.7"
dependency "com.mysql:mysql-connector-j:8.4.0"
dependency "org.springframework.boot:spring-boot-starter-jetty:2.7.18"
dependency "org.locationtech.jts:jts-core:1.19.0"
dependency "org.locationtech.jts:jts-core:1.20.0"
}
}
}
2 changes: 1 addition & 1 deletion eventmesh-admin-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
implementation "com.alibaba:druid-spring-boot-starter"
compileOnly 'com.mysql:mysql-connector-j'
compileOnly 'org.projectlombok:lombok'
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
}
Expand Down
2 changes: 1 addition & 1 deletion eventmesh-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

def grpcVersion = '1.66.0'
def grpcVersion = '1.68.0'

dependencies {
api "com.google.guava:guava"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.eventmesh.common.stubs;

import org.apache.eventmesh.common.protocol.http.common.ProtocolKey;
import org.apache.eventmesh.common.protocol.http.header.Header;
import org.apache.eventmesh.common.utils.HttpConvertsUtils;

import java.util.Map;

public class HeaderStub extends Header {

public String code;
public String eventmeshenv;

@Override
public Map<String, Object> toMap() {
return new HttpConvertsUtils().httpMapConverts(this, new ProtocolKey(), new ProtocolKey.EventMeshInstanceKey());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.eventmesh.common.utils;

import org.apache.eventmesh.common.protocol.http.common.ProtocolKey;
import org.apache.eventmesh.common.protocol.http.common.ProtocolKey.EventMeshInstanceKey;
import org.apache.eventmesh.common.protocol.http.header.Header;
import org.apache.eventmesh.common.stubs.HeaderStub;

import java.util.HashMap;
import java.util.Map;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class HttpConvertsUtilsTest {

private final HeaderStub headerStub = new HeaderStub();
private final ProtocolKey mockedProtocolKey = new ProtocolKey();
private final EventMeshInstanceKey mockedEventMeshProtocolKey = new EventMeshInstanceKey();

@Test
void httpMapConverts() {
Map<String, Object> httpMapConverts = new HttpConvertsUtils().httpMapConverts(headerStub, mockedProtocolKey);
Assertions.assertEquals(httpMapConverts.get(headerStub.code), headerStub.code);
}

@Test
void testHttpMapConverts() {
Map<String, Object> httpMapConverts = new HttpConvertsUtils().httpMapConverts(headerStub, mockedProtocolKey, mockedEventMeshProtocolKey);
Assertions.assertEquals(httpMapConverts.get(headerStub.code), headerStub.code);
Assertions.assertEquals(httpMapConverts.get(headerStub.eventmeshenv), headerStub.eventmeshenv);
}

@Test
void httpHeaderConverts() {
HashMap<String, Object> headerParams = new HashMap<>();
String code = "test";
headerParams.put("code", code);
Header header = new HttpConvertsUtils().httpHeaderConverts(headerStub, headerParams);
Assertions.assertEquals(code, header.toMap().get("code"));
}

@Test
void testHttpHeaderConverts() {
HashMap<String, Object> headerParams = new HashMap<>();
String env = "test";
headerParams.put("eventmeshenv", env);
Header header = new HttpConvertsUtils().httpHeaderConverts(headerStub, headerParams, mockedEventMeshProtocolKey);
Assertions.assertEquals(env, header.toMap().get("eventmeshenv"));
}
}
Loading

0 comments on commit 64fb42c

Please sign in to comment.