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

Waffle / waffle / 6364

01 Feb 2026 02:07AM UTC coverage: 46.217%. Remained the same
6364

push

github

web-flow
Merge pull request #3206 from Waffle/renovate/checkstyle.version

Update dependency com.puppycrawl.tools:checkstyle to v13.1.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

43.75
/Source/JNA/waffle-tests/src/main/java/waffle/mock/MockWindowsSecurityContext.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 com.sun.jna.platform.win32.Sspi.CtxtHandle;
10
import com.sun.jna.platform.win32.Sspi.SecBufferDesc;
11

12
import java.util.ArrayList;
13
import java.util.List;
14

15
import waffle.windows.auth.IWindowsIdentity;
16
import waffle.windows.auth.IWindowsImpersonationContext;
17
import waffle.windows.auth.IWindowsSecurityContext;
18

19
/**
20
 * The Class MockWindowsSecurityContext.
21
 */
22
public class MockWindowsSecurityContext implements IWindowsSecurityContext {
23

24
    /** The identity. */
25
    private final IWindowsIdentity identity;
26

27
    /**
28
     * Instantiates a new mock windows security context.
29
     *
30
     * @param username
31
     *            the username
32
     */
33
    public MockWindowsSecurityContext(final String username) {
2✔
34
        final List<String> groups = new ArrayList<>();
2✔
35
        groups.add("Users");
2✔
36
        groups.add("Everyone");
2✔
37
        this.identity = new MockWindowsIdentity(username, groups);
2✔
38
    }
2✔
39

40
    @Override
41
    public void dispose() {
42
        // Do Nothing
43
    }
×
44

45
    @Override
46
    public boolean isContinue() {
47
        return false;
×
48
    }
49

50
    @Override
51
    public CtxtHandle getHandle() {
52
        return new CtxtHandle();
×
53
    }
54

55
    @Override
56
    public IWindowsIdentity getIdentity() {
57
        return this.identity;
2✔
58
    }
59

60
    @Override
61
    public String getPrincipalName() {
62
        return this.identity.getFqn();
×
63
    }
64

65
    @Override
66
    public String getSecurityPackage() {
67
        return "Mock";
×
68
    }
69

70
    @Override
71
    public byte[] getToken() {
72
        return new byte[0];
×
73
    }
74

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

80
    /**
81
     * Initialize.
82
     */
83
    public void initialize() {
84
        // Do Nothing
85
    }
×
86

87
    @Override
88
    public void initialize(final CtxtHandle continueCtx, final SecBufferDesc continueToken,
89
            final String targetPrincipalName) {
90
        // Do Nothing
91
    }
×
92

93
}
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