View Javadoc
1   /*
2    *    Copyright 2010-2022 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.mybatis.jpetstore.web.actions;
17  
18  import static org.assertj.core.api.Assertions.assertThat;
19  
20  import org.junit.jupiter.api.Test;
21  import org.mybatis.jpetstore.domain.Account;
22  
23  class AccountActionBeanTest {
24  
25    // Test written by Diffblue Cover.
26    @Test
27    void getMyListOutputNull() {
28  
29      // Arrange
30      final AccountActionBean accountActionBean = new AccountActionBean();
31  
32      // Act and Assert result
33      assertThat(accountActionBean.getMyList()).isNull();
34  
35    }
36  
37    // Test written by Diffblue Cover.
38    @Test
39    void constructorOutputNotNull() {
40  
41      // Act, creating object to test constructor
42      final AccountActionBean actual = new AccountActionBean();
43  
44      // Assert result
45      assertThat(actual).isNotNull();
46      assertThat(actual.getContext()).isNull();
47  
48    }
49  
50    // Test written by Diffblue Cover.
51    @Test
52    void getPasswordOutputNull() {
53  
54      // Arrange
55      final AccountActionBean accountActionBean = new AccountActionBean();
56  
57      // Act and Assert result
58      assertThat(accountActionBean.getPassword()).isNull();
59  
60    }
61  
62    // Test written by Diffblue Cover.
63    @Test
64    void isAuthenticatedOutputFalse() {
65  
66      // Arrange
67      final AccountActionBean accountActionBean = new AccountActionBean();
68  
69      // Act and Assert result
70      assertThat(accountActionBean.isAuthenticated()).isFalse();
71  
72    }
73  
74    // Test written by Diffblue Cover.
75    @Test
76    void getUsernameOutputNull() {
77  
78      // Arrange
79      final AccountActionBean accountActionBean = new AccountActionBean();
80  
81      // Act and Assert result
82      assertThat(accountActionBean.getUsername()).isNull();
83  
84    }
85  
86    // Test written by Diffblue Cover.
87    @Test
88    void getAccountOutputNotNull() {
89  
90      // Arrange
91      final AccountActionBean accountActionBean = new AccountActionBean();
92  
93      // Act
94      final Account actual = accountActionBean.getAccount();
95  
96      // Assert result
97      assertThat(actual).isNotNull();
98      assertThat(actual.getAddress2()).isNull();
99      assertThat(actual.getState()).isNull();
100     assertThat(actual.getFirstName()).isNull();
101     assertThat(actual.getPassword()).isNull();
102     assertThat(actual.getLanguagePreference()).isNull();
103     assertThat(actual.getFavouriteCategoryId()).isNull();
104     assertThat(actual.getCountry()).isNull();
105     assertThat(actual.getPhone()).isNull();
106     assertThat(actual.getUsername()).isNull();
107     assertThat(actual.getLastName()).isNull();
108     assertThat(actual.getAddress1()).isNull();
109     assertThat(actual.getEmail()).isNull();
110     assertThat(actual.getStatus()).isNull();
111     assertThat(actual.getBannerName()).isNull();
112     assertThat(actual.getZip()).isNull();
113     assertThat(actual.getCity()).isNull();
114 
115   }
116 }