Skip to content

Commit 98ea756

Browse files
committed
chore: add tests for useApplicationStore
1 parent 2acb760 commit 98ea756

File tree

5 files changed

+1003
-5
lines changed

5 files changed

+1003
-5
lines changed

spring-boot-admin-server-ui/src/main/frontend/composables/useApplicationStore.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,27 @@ const error = ref(null);
99

1010
export function createApplicationStore() {
1111
applicationStore = new ApplicationStore();
12-
console.log('createApplicationStore');
1312
return applicationStore;
1413
}
1514

1615
export function useApplicationStore() {
1716
applicationStore.addEventListener('connected', () => {
18-
console.log('connected');
1917
applicationsInitialized.value = true;
2018
error.value = null;
2119
});
2220

2321
applicationStore.addEventListener('changed', (newApplications) => {
24-
console.log('changed');
2522
applicationsInitialized.value = true;
2623
applications.value = newApplications;
2724
error.value = null;
2825
});
2926

3027
applicationStore.addEventListener('error', (errorResponse) => {
31-
console.log('error');
3228
applicationsInitialized.value = true;
3329
error.value = errorResponse;
3430
});
3531

3632
applicationStore.addEventListener('removed', () => {
37-
console.log('removed');
3833
applicationsInitialized.value = false;
3934
});
4035

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
export const registerWithOneInstance = {
2+
name: 'spring-boot-admin-sample-servlet',
3+
buildVersion: '3.0.0-SNAPSHOT',
4+
status: 'UP',
5+
statusTimestamp: '2022-12-19T10:07:20.646905Z',
6+
instances: [
7+
{
8+
id: '25b07dc98984',
9+
version: 3,
10+
registration: {
11+
name: 'spring-boot-admin-sample-servlet',
12+
managementUrl:
13+
'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator',
14+
healthUrl:
15+
'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/health',
16+
serviceUrl:
17+
'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/',
18+
source: 'http-api',
19+
metadata: {
20+
'tags.de-service-test-6': 'A large content',
21+
'tags.de-service-test-4': 'A large content',
22+
'tags.de-service-test-5': 'A large content',
23+
startup: '2022-12-19T11:04:38.171314+01:00',
24+
'kubectl.kubernetes.iolast-applied-configuration':
25+
'{"name":"jvm.threads.peak","description":"The peak live thread count since the Java virtual machine started or peak was reset","baseUnit":"threads","measurements":[{"statistic":"VALUE","value":64.0}],"availableTags":[]}',
26+
'user.name': 'user',
27+
'tags.de-service-test-2': 'A large content',
28+
'user.password': '******',
29+
'tags.de-service-test-3': 'A large content',
30+
'tags.environment': 'test',
31+
'tags.de-service-test-1': 'A large content',
32+
},
33+
},
34+
registered: true,
35+
statusInfo: {
36+
status: 'UP',
37+
details: {
38+
reactiveDiscoveryClients: {
39+
description: 'Discovery Client not initialized',
40+
status: 'UNKNOWN',
41+
components: {
42+
'Simple Reactive Discovery Client': {
43+
description: 'Discovery Client not initialized',
44+
status: 'UNKNOWN',
45+
},
46+
},
47+
},
48+
clientConfigServer: {
49+
status: 'UNKNOWN',
50+
details: { error: 'no property sources located' },
51+
},
52+
diskSpace: {
53+
status: 'UP',
54+
details: {
55+
total: 994662584320,
56+
free: 333813846016,
57+
threshold: 10485760,
58+
path: '/Users/stekoe/workspaces/cc/spring-boot-admin/spring-boot-admin-samples/spring-boot-admin-sample-servlet/.',
59+
exists: true,
60+
},
61+
},
62+
ping: { status: 'UP' },
63+
discoveryComposite: {
64+
description: 'Discovery Client not initialized',
65+
status: 'UNKNOWN',
66+
components: {
67+
discoveryClient: {
68+
description: 'Discovery Client not initialized',
69+
status: 'UNKNOWN',
70+
},
71+
},
72+
},
73+
refreshScope: { status: 'UP' },
74+
db: {
75+
status: 'UP',
76+
details: {
77+
database: 'HSQL Database Engine',
78+
validationQuery: 'isValid()',
79+
},
80+
},
81+
},
82+
},
83+
statusTimestamp: '2022-12-19T10:04:39.457363Z',
84+
info: {
85+
build: {
86+
artifact: 'spring-boot-admin-sample-servlet',
87+
name: 'Spring Boot Admin Sample Servlet',
88+
time: '2022-12-16T07:23:45.732Z',
89+
version: '3.0.0-SNAPSHOT',
90+
group: 'de.codecentric',
91+
},
92+
},
93+
endpoints: [
94+
{
95+
id: 'caches',
96+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/caches',
97+
},
98+
{
99+
id: 'loggers',
100+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/loggers',
101+
},
102+
{
103+
id: 'heapdump',
104+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/heapdump',
105+
},
106+
{
107+
id: 'features',
108+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/features',
109+
},
110+
{
111+
id: 'startup',
112+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/startup',
113+
},
114+
{
115+
id: 'beans',
116+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/beans',
117+
},
118+
{
119+
id: 'configprops',
120+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/configprops',
121+
},
122+
{
123+
id: 'threaddump',
124+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/threaddump',
125+
},
126+
{
127+
id: 'auditevents',
128+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/auditevents',
129+
},
130+
{
131+
id: 'info',
132+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/info',
133+
},
134+
{
135+
id: 'resume',
136+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/resume',
137+
},
138+
{
139+
id: 'sessions',
140+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/sessions',
141+
},
142+
{
143+
id: 'restart',
144+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/restart',
145+
},
146+
{
147+
id: 'logfile',
148+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/logfile',
149+
},
150+
{
151+
id: 'custom',
152+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/custom',
153+
},
154+
{
155+
id: 'health',
156+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/health',
157+
},
158+
{
159+
id: 'refresh',
160+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/refresh',
161+
},
162+
{
163+
id: 'env',
164+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/env',
165+
},
166+
{
167+
id: 'pause',
168+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/pause',
169+
},
170+
{
171+
id: 'scheduledtasks',
172+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/scheduledtasks',
173+
},
174+
{
175+
id: 'mappings',
176+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/mappings',
177+
},
178+
{
179+
id: 'metrics',
180+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/metrics',
181+
},
182+
{
183+
id: 'conditions',
184+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/conditions',
185+
},
186+
{
187+
id: 'httpexchanges',
188+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/httpexchanges',
189+
},
190+
{
191+
id: 'shutdown',
192+
url: 'http://ip-192-168-178-20.eu-central-1.compute.internal:8080/actuator/shutdown',
193+
},
194+
],
195+
buildVersion: '3.0.0-SNAPSHOT',
196+
tags: {
197+
'de-service-test-6': 'A large content',
198+
'de-service-test-4': 'A large content',
199+
'de-service-test-5': 'A large content',
200+
'de-service-test-2': 'A large content',
201+
'de-service-test-3': 'A large content',
202+
environment: 'test',
203+
'de-service-test-1': 'A large content',
204+
},
205+
},
206+
],
207+
};

0 commit comments

Comments
 (0)