Skip to content

Commit 7c37e51

Browse files
committed
Implement backend driver feature list
1 parent 82b7bb2 commit 7c37e51

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
package neo4j.org.testkit.backend.messages.requests;
20+
21+
import lombok.Getter;
22+
import lombok.NoArgsConstructor;
23+
import lombok.Setter;
24+
import neo4j.org.testkit.backend.TestkitState;
25+
import neo4j.org.testkit.backend.messages.responses.FeatureList;
26+
import neo4j.org.testkit.backend.messages.responses.TestkitResponse;
27+
28+
import java.util.Collections;
29+
import java.util.HashSet;
30+
import java.util.Set;
31+
32+
@Setter
33+
@Getter
34+
@NoArgsConstructor
35+
public class GetFeatures implements TestkitRequest
36+
{
37+
// todo fix typo once testkit side is updated
38+
private static final Set<String> FEATURES = new HashSet<>( Collections.singletonList( "AutorizationExpiredTreament" ) );
39+
40+
@Override
41+
public TestkitResponse process( TestkitState testkitState )
42+
{
43+
return FeatureList.builder().data( FeatureList.FeatureListBody.builder().features( FEATURES ).build() ).build();
44+
}
45+
}

testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/TestkitRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
@JsonSubTypes.Type( SessionLastBookmarks.class ), @JsonSubTypes.Type( SessionWriteTransaction.class ),
3636
@JsonSubTypes.Type( ResolverResolutionCompleted.class ), @JsonSubTypes.Type( CheckMultiDBSupport.class ),
3737
@JsonSubTypes.Type( DomainNameResolutionCompleted.class ), @JsonSubTypes.Type( StartTest.class ),
38-
@JsonSubTypes.Type( TransactionRollback.class )
38+
@JsonSubTypes.Type( TransactionRollback.class ), @JsonSubTypes.Type( GetFeatures.class )
3939
} )
4040
public interface TestkitRequest
4141
{
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright (c) "Neo4j"
3+
* Neo4j Sweden AB [http://neo4j.com]
4+
*
5+
* This file is part of Neo4j.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
package neo4j.org.testkit.backend.messages.responses;
20+
21+
import lombok.Builder;
22+
import lombok.Getter;
23+
import lombok.Setter;
24+
25+
import java.util.Set;
26+
27+
@Setter
28+
@Getter
29+
@Builder
30+
public class FeatureList implements TestkitResponse
31+
{
32+
private final FeatureListBody data;
33+
34+
@Override
35+
public String testkitName()
36+
{
37+
return "FeatureList";
38+
}
39+
40+
@Setter
41+
@Getter
42+
@Builder
43+
public static class FeatureListBody
44+
{
45+
private final Set<String> features;
46+
}
47+
}

0 commit comments

Comments
 (0)