mirror of
https://gitee.com/dcren/initializr.git
synced 2025-12-02 19:34:05 +08:00
Add agent for VS Code
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2017 the original author or authors.
|
* Copyright 2012-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -75,6 +75,8 @@ public class Agent {
|
|||||||
|
|
||||||
NETBEANS("netbeans", "NetBeans"),
|
NETBEANS("netbeans", "NetBeans"),
|
||||||
|
|
||||||
|
VSCODE("vscode", "vscode"),
|
||||||
|
|
||||||
BROWSER("browser", "Browser");
|
BROWSER("browser", "Browser");
|
||||||
|
|
||||||
final String id;
|
final String id;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2017 the original author or authors.
|
* Copyright 2012-2018 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -79,6 +79,13 @@ public class AgentTests {
|
|||||||
assertThat(agent.getVersion(), is("0.1"));
|
assertThat(agent.getVersion(), is("0.1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void checkVsCode() {
|
||||||
|
Agent agent = Agent.fromUserAgent("vscode/0.2.0");
|
||||||
|
assertThat(agent.getId(), equalTo(Agent.AgentId.VSCODE));
|
||||||
|
assertThat(agent.getVersion(), is("0.2.0"));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void checkGenericBrowser() {
|
public void checkGenericBrowser() {
|
||||||
Agent agent = Agent.fromUserAgent(
|
Agent agent = Agent.fromUserAgent(
|
||||||
|
|||||||
Reference in New Issue
Block a user