1+ /*
2+ * Copyright 2018-present the original author or authors.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * https://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package org .springframework .shell ;
17+
18+ import org .junit .jupiter .api .BeforeEach ;
19+ import org .junit .jupiter .api .Test ;
20+
21+ import static org .junit .jupiter .api .Assertions .assertEquals ;
22+
23+ public class CompletionProposalTest {
24+
25+ private final String PROPOSAL = "test proposal" ;
26+ private final String DESCRIPTION = "description" ;
27+ private final String DISPLAY_TEXT = "displayText" ;
28+ private final boolean DONT_QUOTE = true ;
29+ private final String CATEGORY = "category" ;
30+ CompletionProposal completionProposal ;
31+
32+
33+ @ BeforeEach
34+ public void setup () {
35+ completionProposal = new CompletionProposal (PROPOSAL );
36+ completionProposal .category (CATEGORY );
37+ completionProposal .description (DESCRIPTION );
38+ completionProposal .displayText (DISPLAY_TEXT );
39+ completionProposal .dontQuote (DONT_QUOTE );
40+ }
41+
42+ @ Test
43+ public void equals () {
44+ CompletionProposal completionProposal2 = new CompletionProposal (PROPOSAL );
45+ completionProposal2 .category (CATEGORY );
46+ completionProposal2 .description (DESCRIPTION );
47+ completionProposal2 .displayText (DISPLAY_TEXT );
48+ completionProposal2 .dontQuote (DONT_QUOTE );
49+
50+ assertEquals (completionProposal , completionProposal2 );
51+ }
52+
53+ @ Test
54+ public void hashcode () {
55+ CompletionProposal completionProposal2 = new CompletionProposal (PROPOSAL );
56+ completionProposal2 .category (CATEGORY );
57+ completionProposal2 .description (DESCRIPTION );
58+ completionProposal2 .displayText (DISPLAY_TEXT );
59+ completionProposal2 .dontQuote (DONT_QUOTE );
60+ assertEquals (completionProposal .hashCode (), completionProposal2 .hashCode ());
61+ }
62+ }
0 commit comments