• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Waffle / waffle / 6516

11 Mar 2026 12:15AM UTC coverage: 46.217%. Remained the same
6516

push

github

web-flow
Update dependency org.eclipse.jdt:ecj to v3.45.0

276 of 734 branches covered (37.6%)

Branch coverage included in aggregate %.

1019 of 2068 relevant lines covered (49.27%)

1.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/Source/JNA/waffle-tests/src/main/java/waffle/mock/MockWindowsIdentity.java
1
/*
2
 * SPDX-License-Identifier: MIT
3
 * See LICENSE file for details.
4
 *
5
 * Copyright 2010-2026 The Waffle Project Contributors: https://github.com/Waffle/waffle/graphs/contributors
6
 */
7
package waffle.mock;
8

9
import java.util.ArrayList;
10
import java.util.List;
11

12
import waffle.windows.auth.IWindowsAccount;
13
import waffle.windows.auth.IWindowsIdentity;
14
import waffle.windows.auth.IWindowsImpersonationContext;
15

16
/**
17
 * A Mock windows identity.
18
 */
19
public class MockWindowsIdentity implements IWindowsIdentity {
20

21
    /** The fqn. */
22
    private final String fqn;
23

24
    /** The groups. */
25
    private final List<String> groups;
26

27
    /**
28
     * Instantiates a new mock windows identity.
29
     *
30
     * @param newFqn
31
     *            the new fqn
32
     * @param newGroups
33
     *            the new groups
34
     */
35
    public MockWindowsIdentity(final String newFqn, final List<String> newGroups) {
2✔
36
        this.fqn = newFqn;
2✔
37
        this.groups = newGroups;
2✔
38
    }
2✔
39

40
    @Override
41
    public String getFqn() {
42
        return this.fqn;
2✔
43
    }
44

45
    @Override
46
    public IWindowsAccount[] getGroups() {
47
        final List<MockWindowsAccount> groupsList = new ArrayList<>();
2✔
48
        for (final String group : this.groups) {
2✔
49
            groupsList.add(new MockWindowsAccount(group));
2✔
50
        }
2✔
51
        return groupsList.toArray(new IWindowsAccount[0]);
2✔
52
    }
53

54
    @Override
55
    public byte[] getSid() {
56
        return new byte[0];
2✔
57
    }
58

59
    @Override
60
    public String getSidString() {
61
        return "S-" + this.fqn.hashCode();
2✔
62
    }
63

64
    @Override
65
    public void dispose() {
66
        // Do Nothing
67
    }
2✔
68

69
    @Override
70
    public boolean isGuest() {
71
        return "Guest".equals(this.fqn);
2✔
72
    }
73

74
    @Override
75
    public IWindowsImpersonationContext impersonate() {
76
        return new MockWindowsImpersonationContext();
×
77
    }
78

79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc