forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pinpoint-apm#11346] Optimize agent lookup for agent compatibility
- Loading branch information
Showing
7 changed files
with
89 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
grpc/src/test/java/com/navercorp/pinpoint/grpc/server/lifecycle/PingSessionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.navercorp.pinpoint.grpc.server.lifecycle; | ||
|
||
import com.navercorp.pinpoint.common.trace.ServiceType; | ||
import com.navercorp.pinpoint.grpc.Header; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Collections; | ||
|
||
class PingSessionTest { | ||
|
||
@Test | ||
void getServiceType() { | ||
Header header = new Header("name", "agentId", "agentName", "appName", | ||
ServiceType.SPRING.getCode(), 11, 22, Collections.emptyList()); | ||
PingSession session = new PingSession(1L, header); | ||
|
||
Assertions.assertEquals(ServiceType.SPRING.getCode(), session.getServiceType()); | ||
|
||
session.setServiceType(ServiceType.TEST.getCode()); | ||
Assertions.assertEquals(ServiceType.SPRING.getCode(), session.getServiceType()); | ||
} | ||
|
||
@Test | ||
void getServiceType_undefined() { | ||
Header header = new Header("name", "agentId", "agentName", "appName", | ||
ServiceType.UNDEFINED.getCode(), 11, 22, Collections.emptyList()); | ||
PingSession session = new PingSession(1L, header); | ||
|
||
Assertions.assertEquals(ServiceType.UNDEFINED.getCode(), session.getServiceType()); | ||
|
||
session.setServiceType(ServiceType.SPRING.getCode()); | ||
Assertions.assertEquals(ServiceType.SPRING.getCode(), session.getServiceType()); | ||
} | ||
} |